Skip to content

Use NuGet Trusted Publishing for release push - #251

Merged
stesee merged 1 commit into
mainfrom
nuget-trusted-publishing
Nov 2, 2026
Merged

stesee merged 1 commit into
mainfrom
nuget-trusted-publishing

Conversation

@stesee

@stesee stesee commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces the long-lived NUGET_TOKEN API key in deployRelease with NuGet Trusted Publishing. NuGet/login@v1 exchanges the GitHub OIDC token for a short-lived API key. The last release run failed because the stored key had expired.

Changes:

  • deployRelease gets id-token: write for OIDC and contents: write for gh release create.
  • A new NuGet/login@v1 step reads the nuget.org profile name from the NUGET_USER secret.
  • dotnet nuget push now uses the temporary key from the login step.

Setup needed before merging:

  1. On nuget.org, add a Trusted Publishing policy: owner Codeuctivity, repository OpenXmlPowerTools, workflow file dotnet.yml.
  2. Add a repository secret NUGET_USER that holds the nuget.org profile name (not the email address).

deployTest, which pushes to nugettest.org, still uses NUGET_TEST_TOKEN and is unchanged.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@stesee
stesee merged commit dcb0c67 into main Nov 2, 2026
6 checks passed
@stesee
stesee deleted the nuget-trusted-publishing branch November 2, 2026 05:25
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants