Skip to content

ci: publish to NuGet with Trusted Publishing - #151

Merged
erwan-joly merged 1 commit into
masterfrom
nuget-trusted-publishing
Nov 3, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
nuget-trusted-publishing

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The NuGet API keys expired on 2026-11-01 and nuget.org now caps new keys at 30 days. This switches the release job to NuGet Trusted Publishing: the job exchanges a GitHub OIDC token for a short-lived API key via NuGet/login, so there is no stored key to rotate.

The matching Trusted Publishing policy (owner NosCore, repo NosCoreIO/NosCore.Algorithm, workflow dotnet.yml) is already active on nuget.org.

Once this is merged and a tag publishes successfully, the NUGET_API_KEY repo secret and the expired nuget.org key can be deleted.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the NuGet package publishing process to use a login-generated credential for releases triggered by matching version tags.

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

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The release workflow adds OIDC token permission, conditionally logs in to NuGet for matching version tags, and uses the login step’s API key output when pushing packages.

Changes

NuGet publishing authentication

Layer / File(s) Summary
Configure release authentication
.github/workflows/dotnet.yml
The release job gains id-token: write. A conditional NuGet login step exposes an API key output, which the package push now uses instead of secrets.NUGET_API_KEY.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Minimal · up to b1311

The workflow switches publishing to short-lived NuGet credentials. No actionable defect is established; the organization owner and individual login username need not be identical.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: publishing to NuGet through Trusted Publishing.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5ec74f7 and b131124.

Files selected for processing: 1
  • .github/workflows/dotnet.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@erwan-joly
erwan-joly merged commit 19fc08a into master Nov 3, 2026
3 checks passed
@erwan-joly
erwan-joly deleted the nuget-trusted-publishing branch November 3, 2026 09:11
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