Package Release to GitHub and Nuget #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Package to NuGet | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release-nuget: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 9.x | |
| 8.x | |
| 7.x | |
| 6.x | |
| cache: true | |
| cache-dependency-path: '**/packages.lock.json' | |
| - name: Restore dependencies | |
| run: dotnet restore --locked-mode | |
| - name: Build | |
| run: dotnet build --no-restore -c Release | |
| - name: Generate Nuget Package | |
| run: dotnet pack --no-build -c Release --output ./artifacts | |
| - name: Publish Nuget Package | |
| run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |