ci(release): NuGet Trusted Publishing (OIDC, keyless) instead of an API key - #78
Merged
Conversation
Replace the long-lived NUGET_API_KEY secret with NuGet Trusted Publishing: the release job now requests a GitHub OIDC token (id-token: write) and exchanges it via NuGet/login@v1 (SHA-pinned) for a short-lived (1h) API key minted right before the push. Per NuGet's guidance that API keys are discouraged for automated publishing. Requires a one-time nuget.org policy (owner=grinidx, repo=UniswapSharp, workflow=release.yml) and a NUGET_USER secret (nuget.org profile username, not a key). Updated CLAUDE.md publishing note accordingly.
SummarySummary
CoverageUniswapSharp - 85.2%
|
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.
Per NuGet's guidance that long-lived API keys are discouraged for automated publishing, switch
release.ymlto Trusted Publishing (OIDC).What changes
id-token: writeto the publish job so GitHub issues an OIDC token.NuGet/login@v1, SHA-pinned to8d19675) that exchanges the OIDC token for a short-lived (1 hour) NuGet API key, requested right before the push.dotnet nuget pushnow uses${{ steps.nuget-login.outputs.NUGET_API_KEY }}— noNUGET_API_KEYsecret stored anywhere.One-time setup required before the first release (maintainer)
grinidxUniswapSharprelease.yml(filename only)gh secret set NUGET_USER→ your nuget.org profile username (not email, not a key).No code/test impact; source: NuGet Trusted Publishing docs.