publish #1
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 | |
| # Publishes the Bobcat NuGet packages. The version is centralized in | |
| # src/Directory.Build.props (<Version>); bump it there to cut a release. | |
| # Trigger by pushing a tag like `v0.5.0`, or run manually from the Actions tab. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore -c Release | |
| - name: Test | |
| run: dotnet test --no-build -c Release --verbosity normal | |
| - name: Pack | |
| run: dotnet pack --no-build -c Release -o ${{ github.workspace }}/artifacts | |
| - name: Push to NuGet | |
| run: > | |
| dotnet nuget push "${{ github.workspace }}/artifacts/*.nupkg" | |
| --source https://api.nuget.org/v3/index.json | |
| --api-key ${{ secrets.NUGET_API_KEY }} | |
| --skip-duplicate |