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: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore FModBankParser/FModBankParser.csproj | |
| - name: Build | |
| run: dotnet build FModBankParser/FModBankParser.csproj --configuration Release --no-restore | |
| - name: Pack NuGet package | |
| run: | | |
| dotnet pack FModBankParser/FModBankParser.csproj \ | |
| --configuration Release \ | |
| --no-build \ | |
| -p:PackageVersion=${{ github.event.release.tag_name }} \ | |
| -o ./nupkg | |
| - name: NuGet login (OIDC -> temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Publish to NuGet.org | |
| run: | | |
| dotnet nuget push ./nupkg/*.nupkg \ | |
| --api-key ${{ steps.login.outputs.NUGET_API_KEY }} \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --skip-duplicate | |
| - name: Publish to GitHub Packages | |
| run: | | |
| dotnet nuget push ./nupkg/*.nupkg \ | |
| --api-key ${{ secrets.GITHUB_TOKEN }} \ | |
| --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | |
| --skip-duplicate |