ci: use OIDC for NuGet package push authentication#715
Merged
Conversation
This updates the build-release workflow to leverage OpenID Connect (OIDC) for authenticating with NuGet.org. The package push operation is now performed directly within the build job, replacing static API key usage with ephemeral credentials for enhanced security.
There was a problem hiding this comment.
Pull request overview
Updates the release pipeline to publish NuGet packages using NuGet.org Trusted Publishing via GitHub OIDC, replacing the prior static API-key-based push path in the release workflow.
Changes:
- Adds a dedicated
publishjob that authenticates to NuGet.org via OIDC and pushes the produced packages. - Updates the .NET packing step to include symbol package generation.
- Rewires workflow dependencies so
create-releaseruns after the new publish job and disablesnuget-pushin the reusable release workflow call.
Comments suppressed due to low confidence (1)
.github/workflows/build-release.yaml:120
dotnet packis configured to produce symbol packages, but the push command only matches*.nupkg, so the generated.snupkg(default symbol package format) won’t be published to NuGet.org. Either push both*.nupkgand*.snupkg, or setSymbolPackageFormat=symbols.nupkgso the existing glob includes symbols.
- run: dotnet nuget push "./nuget/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}"
if: ${{ !inputs.dry-run }}
env:
NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the build-release workflow to leverage OpenID Connect (OIDC) for authenticating with NuGet.org. The package push operation is now performed directly within the build job, replacing static API key usage with ephemeral credentials for enhanced security.