Skip to content

ci: publish to NuGet with Trusted Publishing - #72

Merged
AerafalDev merged 1 commit into
mainfrom
ci/nuget-trusted-publishing
Nov 17, 2026
Merged

AerafalDev merged 1 commit into
mainfrom
ci/nuget-trusted-publishing

Conversation

@AerafalDev

Copy link
Copy Markdown
Owner

The NUGET_API_KEY secret has expired, and every push of v1.8.1 to NuGet failed with a 403. This PR moves the Publish workflow to NuGet Trusted Publishing, so the repository no longer stores a NuGet key.

  • The publish job gets id-token: write, so it can ask GitHub for an OIDC token.
  • A new NuGet/login@v1 step (user: jimmy-mll) trades that token for a short-lived API key. dotnet nuget push uses the key from this step instead of secrets.NUGET_API_KEY.
  • The matching policy already exists on nuget.org: owner jimmy-mll, repository AerafalDev/ShockwaveFlash, workflow publish.yml, no environment.

After merging: run Publish from main with the existing tag (gh workflow run publish.yml --ref main -f tag=v1.8.1). A manual run uses the workflow file from main and only checks out the tag's sources, so v1.8.1 does not need to move. Once 1.8.1 is published, the old NUGET_API_KEY secret can be deleted.

🤖 Generated with Claude Code

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.
@AerafalDev
AerafalDev merged commit 7dcf7d1 into main Nov 17, 2026
4 checks passed
@AerafalDev
AerafalDev deleted the ci/nuget-trusted-publishing branch November 17, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant