ci: migrate npm publishing to OIDC trusted publishing - #10
Open
upsetbit wants to merge 2 commits into
Open
Conversation
Drop NODE_AUTH_TOKEN/NPM_TOKEN and upgrade npm to >= 11.5.1 in-job so the publish authenticates via npm OIDC trusted publishing (id-token: write is already granted). Emit provenance from publish-npm.sh (GitHub-hosted). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OIDC trusted publishing publishes with --provenance, and npm validates each manifest's repository.url against the repo recorded in the sigstore bundle. The four platform sub-packages only declared homepage, so the first publish would fail with 422 Unprocessable Entity — as it did for c3-oss/prosa#320. Nothing surfaces this under NPM_TOKEN, because no provenance statement is generated. Adds the repository field to all four sub-packages and a pre-flight assertion next to the existing version check, so a mismatch aborts before any package is published rather than midway through the loop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Replace the long-lived
NPM_TOKENin the npm release with npm OIDC trusted publishing (GA'd 2025-07-31). The release job exchanges a short-lived GitHub Actions id-token for publish credentials — no stored secret — and provenance is issued automatically.Changes
release.yml: remove theNODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}env; add annpm install -g npm@lateststep (trusted publishing needs npm ≥ 11.5.1).permissions: id-token: writewas already present; the job already runs onubuntu-latest.scripts/publish-npm.sh: add--provenanceto thenpm publishcalls; update the header comment (no token needed).Register the trusted publisher on npm for all 5 packages first, otherwise the tokenless publish fails:
@c3-oss/q+-darwin-arm64,-darwin-amd64,-linux-amd64,-linux-arm64— repoc3-oss/q, workflowrelease.yml. Run the org-widesetup-trusted-publishers.sh.Suggested validation: cut a pre-release tag (e.g.
v<next>-rc1) and confirm the publish is green with a provenance badge and noNPM_TOKENuse. Keep theNPM_TOKENsecret until validated, then delete it.🤖 Generated with Claude Code