Repository navigation
ci: publish to NuGet with Trusted Publishing - #72
Merged
Merged
Conversation
The long-lived NUGET_API_KEY secret expired, so the v1.8.1 publish was rejected with a 403. The job now asks for a GitHub OIDC token (id-token: write) and trades it with NuGet/login for a short-lived API key, under the nuget.org Trusted Publishing policy for AerafalDev/ShockwaveFlash and publish.yml. No NuGet secret is stored in the repository any more.
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.
The
NUGET_API_KEYsecret has expired, and every push ofv1.8.1to NuGet failed with a 403. This PR moves the Publish workflow to NuGet Trusted Publishing, so the repository no longer stores a NuGet key.publishjob getsid-token: write, so it can ask GitHub for an OIDC token.NuGet/login@v1step (user: jimmy-mll) trades that token for a short-lived API key.dotnet nuget pushuses the key from this step instead ofsecrets.NUGET_API_KEY.jimmy-mll, repositoryAerafalDev/ShockwaveFlash, workflowpublish.yml, no environment.After merging: run Publish from
mainwith the existing tag (gh workflow run publish.yml --ref main -f tag=v1.8.1). A manual run uses the workflow file frommainand only checks out the tag's sources, sov1.8.1does not need to move. Once 1.8.1 is published, the oldNUGET_API_KEYsecret can be deleted.🤖 Generated with Claude Code