Skip to content

ci(release): NuGet Trusted Publishing (OIDC) instead of a long-lived API key - #33

Merged
montfort merged 3 commits into
mainfrom
chore/nuget-trusted-publishing
Jul 19, 2026
Merged

ci(release): NuGet Trusted Publishing (OIDC) instead of a long-lived API key#33
montfort merged 3 commits into
mainfrom
chore/nuget-trusted-publishing

Conversation

@montfort

Copy link
Copy Markdown
Contributor

Switches the publish job in release.yml from a stored NUGET_API_KEY secret to NuGet Trusted Publishing (OIDC), per nuget.org's new recommendation for GitHub Actions.

What changed

  • permissions: id-token: write on the publish job (GitHub OIDC token issuance).
  • New step NuGet/login@v1 exchanges the OIDC token for a short-lived (1 h, single-use) NuGet API key.
  • dotnet nuget push now uses steps.nuget-login.outputs.NUGET_API_KEY (temporary) instead of secrets.NUGET_API_KEY.
  • Fixed a stale header comment.

No long-lived API key to store, rotate, or leak. The publish stays gated behind dry_run=false + the release environment.

Operator setup (one-time, before the real publish — T060)

  1. nuget.org → Trusted Publishing → Add policy: owner = the StrangeDaysTech org; Repository Owner = StrangeDaysTech; Repository = weft; Workflow File = release.yml; Environment = release.
  2. Repo/environment secret NUGET_USER = the nuget.org profile/org username (not the email).
  3. The old NUGET_API_KEY secret is no longer needed.

🤖 Generated with Claude Code

montfort and others added 3 commits July 18, 2026 23:56
Commits the lockfile (lockfileVersion 3) so the Tiptap sample builds
reproducibly — `npm ci`/`npm install` resolve the exact same dependency
tree the sample was verified against, instead of drifting with the caret
ranges in package.json. It was previously untracked (generated when the
sample was run locally).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces the long-lived NUGET_API_KEY secret with NuGet Trusted Publishing:
the publish job requests a GitHub OIDC token (`id-token: write`) and the
NuGet/login@v1 action exchanges it for a short-lived (1 h, single-use) API
key used by `dotnet nuget push`. No API key to store, rotate, or leak.

Requires (operator, one-time):
- A trusted-publisher policy on nuget.org: owner = the StrangeDaysTech org,
  repository owner = StrangeDaysTech, repository = weft, workflow = release.yml,
  environment = release.
- Repo/environment secret NUGET_USER = the nuget.org profile/org username.
- The old NUGET_API_KEY secret can be removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@montfort
montfort merged commit 6734c95 into main Jul 19, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 19, 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.

1 participant