Build and Publish NuGet Packages #3
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: Build and Publish NuGet Packages | |
| on: | |
| workflow_dispatch: | |
| env: | |
| SOLUTION_PATH: ./SerializationGenerator.sln | |
| BUILD_CONFIG: Release | |
| NUGET_SOURCE: https://api.nuget.org/v3/index.json | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: | | |
| dotnet clean | |
| dotnet restore | |
| - name: Build and Pack | |
| run: | | |
| dotnet build -c Release | |
| - name: Publish to NuGet.org | |
| run: | | |
| dotnet nuget push "**/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key "${{ secrets.NUGET_API_KEY }}" --skip-duplicate |