Fix version numbers #93
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 to nuget | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.gitignore' | |
| - '**/*.gitattributes' | |
| - '.github/**/*.*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNETVERSION: 10.0 | |
| DOTNET_NOLOGO: true # Disable the .NET logo | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry | |
| NuGetDirectory: ${{ github.workspace}}/nuget | |
| jobs: | |
| build: | |
| permissions: | |
| id-token: write # enable GitHub OIDC token issuance for this job | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '${{env.DOTNETVERSION}}' | |
| - name: Build | |
| run: | | |
| dotnet restore | |
| dotnet build --configuration Release | |
| dotnet pack --configuration Release --no-build --output "${{ env.NuGetDirectory }}" | |
| # Github artifact have storage costs even after you delete them | |
| # Disable, now that the build process is stable. | |
| # - name: Upload Artifact | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: nuget | |
| # if-no-files-found: error | |
| # retention-days: 2 | |
| # path: ${{ env.NuGetDirectory }}/*.nupkg | |
| # publish: | |
| # runs-on: ubuntu-latest | |
| # needs: build | |
| # steps: | |
| # - uses: actions/download-artifact@v3 | |
| # with: | |
| # name: nuget | |
| # path: ${{ env.NuGetDirectory }} | |
| # Get a short-lived NuGet API key | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push NuGet package | |
| run: | | |
| dotnet nuget push "${{ env.NuGetDirectory }}/*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{steps.login.outputs.NUGET_API_KEY}} | |
| # - name: Delete artifact | |
| # uses: geekyeggo/delete-artifact@v4 | |
| # with: | |
| # name: nuget |