Skip to content

ci: migrate npm publishing to OIDC trusted publishing - #318

Merged
upsetbit merged 2 commits into
masterfrom
oidc-trusted-publishing
Jul 25, 2026
Merged

ci: migrate npm publishing to OIDC trusted publishing#318
upsetbit merged 2 commits into
masterfrom
oidc-trusted-publishing

Conversation

@upsetbit

Copy link
Copy Markdown
Contributor

What & why

Replace the long-lived NPM_TOKEN in 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: add id-token: write to permissions (it was missing); remove the NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} env; add an npm install -g npm@latest step (trusted publishing needs npm ≥ 11.5.1). The job already runs on ubuntu-latest (GitHub-hosted), required for OIDC.
  • scripts/publish-npm.sh: add --provenance to the npm publish calls; update the header comment (no token needed).
  • docs: docs/distribution/{npm,release,README}.md now describe OIDC trusted publishing and drop the NPM_TOKEN secret.

⚠️ Before merging / next release

Register the trusted publisher on npm for all 5 packages first, otherwise the tokenless publish fails:
@c3-oss/prosa + -darwin-arm64, -darwin-amd64, -linux-amd64, -linux-arm64 — repo c3-oss/prosa, workflow release.yml. Run the org-wide setup-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 no NPM_TOKEN use. Keep the NPM_TOKEN secret until validated, then delete it.

🤖 Generated with Claude Code

upsetbit and others added 2 commits July 17, 2026 15:25
Add id-token: write, drop NODE_AUTH_TOKEN/NPM_TOKEN, and upgrade npm to
>= 11.5.1 in-job so the publish authenticates via npm OIDC trusted
publishing. Emit provenance from publish-npm.sh (GitHub-hosted runner).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@upsetbit
upsetbit merged commit e56455e into master Jul 25, 2026
4 checks passed
@upsetbit
upsetbit deleted the oidc-trusted-publishing branch July 25, 2026 14:24
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