Skip to content

Publish to nuget.org with Trusted Publishing - #530

Merged
waf merged 1 commit into
mainfrom
nuget-trusted-publishing
Nov 26, 2026
Merged

waf merged 1 commit into
mainfrom
nuget-trusted-publishing

Conversation

@waf

@waf waf commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Releases were pushed to nuget.org with a long-lived NUGET_TOKEN API key stored as a repo secret. NuGet now discourages API keys for CI and recommends Trusted Publishing instead.
  • release.yml now trades the job's GitHub OIDC token for a nuget.org API key that lasts 1 hour (NuGet/login, pinned to the v1.2.0 commit). It requests the key after the pack step and uses it for both pushes. The workflow now needs id-token: write.
  • The job runs in the release environment. That environment only allows v* tags and matches the environment set in the nuget.org policy, so a modified copy of the workflow on another branch can't publish.

Exchange the release job's GitHub OIDC token for a short-lived nuget.org
API key via NuGet/login, replacing the long-lived NUGET_TOKEN secret. The
job runs in the "release" environment, which is restricted to v* tags and
matches the nuget.org Trusted Publishing policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.4%. Comparing base (21e719b) to head (1b7dd92).

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #530     +/-   ##
=======================================
- Coverage   80.5%   80.4%   -0.1%     
=======================================
  Files        130     130             
  Lines       9503    9503             
  Branches    1432    1432             
=======================================
- Hits        7652    7644      -8     
- Misses      1358    1366      +8     
  Partials     493     493             

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@waf
waf merged commit ee45fad into main Nov 26, 2026
3 checks passed
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