Skip to content

Publish to nuget.org with Trusted Publishing - #311

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_API_KEY secret. NuGet now recommends Trusted Publishing for CI instead of API keys.
  • release.yml now exchanges the job's GitHub OIDC token for a nuget.org API key that lasts 1 hour (NuGet/login v1.2.0). The job runs in the release environment, which only allows v* tags and matches the environment in the nuget.org policy. This adds id-token: write.
  • Every action in both workflows is now pinned to the commit of its latest release: checkout v7.0.1, setup-dotnet v6.1.0, codecov-action v7.1.1.

Exchange the job's GitHub OIDC token for a short-lived nuget.org API key
via NuGet/login instead of using a long-lived NUGET_API_KEY secret. The
release job runs in the "release" environment, which only allows v* tags.

Also pin every action to the commit of its latest release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@waf
waf merged commit f87922b into main Nov 26, 2026
2 checks passed
@waf
waf deleted the nuget-trusted-publishing branch November 26, 2026 15:26
@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 86.7%. Comparing base (5b8cfe4) to head (ec8a849).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #311     +/-   ##
=======================================
- Coverage   86.8%   86.7%   -0.1%     
=======================================
  Files         48      48             
  Lines       4165    4165             
  Branches     691     691             
=======================================
- Hits        3616    3614      -2     
- Misses       384     386      +2     
  Partials     165     165             

☔ 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.

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