Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
jobs:
nuget_build_push:
runs-on: ubuntu-latest
name: Nuget build and push
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_ORG_API_KEY}}
- name: Generate package identifier
run: |
export VERSION=${{ github.event.release.tag_name }}
echo PACKAGE_VERSION=${VERSION#v*} >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
echo "Build version: ${{ env.PACKAGE_VERSION }}"
dotnet build --configuration Release --no-restore
- name: Generate NuGet package
run: dotnet pack ${GITHUB_WORKSPACE}/src/Blazor.SimpleModal.csproj --include-symbols -p:SymbolPackageFormat=snupkg -c Release -o output -p:PackageVersion=${{ env.PACKAGE_VERSION }}
- name: Upload package as artifact
uses: actions/upload-artifact@v4
with:
name: Nuget
path: ./output/*.nupkg
if-no-files-found: error
retention-days: 15
- name: Push generated package to NuGet feed
run: |
dotnet nuget push ./output/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate -n
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_ORG_API_KEY }}