Skip to content

ci: publish with nuget.org Trusted Publishing - #46

Merged
kieronlanning merged 2 commits into
mainfrom
chore/trusted-publishing
Nov 2, 2026
Merged

kieronlanning merged 2 commits into
mainfrom
chore/trusted-publishing

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

nuget.org is retiring long-lived API keys in favour of Trusted Publishing, so the release job now mints a short-lived key from its OIDC token instead of reading a stored secret.

The release pipeline moved from purview-dev/build/.github/workflows/purview-release.yml to purview-dev/build/actions/purview-release, a composite action. That is required, not cosmetic: nuget.org validates the OIDC job_workflow_ref claim against the registered policy, and inside a called workflow that claim names the called repository, never this one (NuGet/NuGetGallery#11000).

  • id-token: write is granted on the job, because GitHub withholds it by default.
  • The four repository variables (PURVIEW_PUBLISH_GITHUB_PACKAGES, PURVIEW_GITHUB_PACKAGES_KEEP_VERSIONS, PURVIEW_GITHUB_PACKAGES_RETENTION_HOURS, PURVIEW_NUGET_SOURCE_MAPPING) are passed as action inputs, since a composite action has no vars context.
  • PURVIEW_PACKAGES_READ_TOKEN is passed explicitly, since a composite action has no secrets context.

Behaviour is otherwise unchanged: same eligibility gate, same GitHub Packages opt-in, same retention.

nuget.org is retiring long-lived API keys in favour of Trusted Publishing, so
the release job now mints a short-lived key from its OIDC token instead of
reading a stored secret.

The release pipeline moved from the reusable workflow to
`purview-dev/build/actions/purview-release`, a composite action. That is
required: nuget.org validates the OIDC `job_workflow_ref` claim, which inside a
called workflow names the called repository rather than this one
(NuGet/NuGetGallery#11000).

`id-token: write` is granted on the job because GitHub withholds it by default.
@kieronlanning
kieronlanning merged commit 3d32c6b into main Nov 2, 2026
1 check passed
@kieronlanning
kieronlanning deleted the chore/trusted-publishing branch November 2, 2026 23:27
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