💚 Fix deployment CI #2
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: Publish NuGet Package | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| jobs: | |
| publish: | |
| name: Publish to NuGet | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build with explicit version | |
| run: | | |
| VERSION=${GITHUB_REF_NAME} | |
| dotnet build \ | |
| --configuration Release \ | |
| -p:Version=$VERSION \ | |
| --no-restore | |
| - name: Pack with symbols | |
| run: | | |
| VERSION=${GITHUB_REF_NAME} | |
| dotnet pack \ | |
| --configuration Release \ | |
| -p:Version=$VERSION \ | |
| -p:IncludeSymbols=true \ | |
| -p:SymbolPackageFormat=snupkg \ | |
| --no-build \ | |
| --output ./nupkgs | |
| - name: Publish .nupkg and .snupkg to NuGet.org | |
| run: | | |
| dotnet nuget push ./nupkgs/*.nupkg \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --api-key ${{ secrets.NUGET_API_KEY }} \ | |
| --skip-duplicate | |
| dotnet nuget push ./nupkgs/*.snupkg \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --api-key ${{ secrets.NUGET_API_KEY }} \ | |
| --skip-duplicate |