Skip to content

ci: publish to nuget.org with trusted publishing - #5

Merged
velddev merged 1 commit into
masterfrom
ci/nuget-trusted-publishing
Oct 31, 2026
Merged

velddev merged 1 commit into
masterfrom
ci/nuget-trusted-publishing

Conversation

@velddev

@velddev velddev commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

The nuget.org push now uses trusted publishing instead of the long-lived NUGET_TOKEN. That key had expired, which is why the 1.0.2 push failed with a 403 (it only reached GitHub Packages). NuGet/login exchanges the job's GitHub OIDC token for an API key that lasts an hour. The job now declares its permissions: id-token: write for the OIDC token, and packages: write so the GitHub Packages push keeps working.

Before merging:

  • On nuget.org, add a trusted publishing policy for the owner of Topgg.ProxyCheck (top): repository owner top-gg, repository ProxyCheck, workflow file dotnet.yml, no environment.
  • Add a NUGET_USER repo secret holding the nuget.org profile name (not the email) of the user who created the policy.

After merging:

  • Delete the NUGET_TOKEN secret.
  • The first master run publishes 1.0.2 to nuget.org. #4 then publishes 1.0.3.

Swaps the long-lived NUGET_TOKEN for a short-lived API key from
NuGet/login, which exchanges the GitHub OIDC token. The old key had
expired, so the 1.0.2 push to nuget.org failed with a 403.
@velddev
velddev merged commit 6cab60d into master Oct 31, 2026
2 checks passed
@velddev
velddev deleted the ci/nuget-trusted-publishing branch October 31, 2026 00:04
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