chore: Publish via npm OIDC trusted publishing - #604
Closed
MatiPl01 wants to merge 1 commit into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
MatiPl01
force-pushed
the
chore/oidc-trusted-publishing
branch
from
July 9, 2026 21:42
4b4e193 to
78ba207
Compare
Yarn's publish path cannot use npm's OIDC trusted publishing, so the release still depended on a long-lived NPM_TOKEN. That token expired and broke the release. Move publishing onto @semantic-release/npm with OIDC: - Bump semantic-release to 25.x, whose bundled @semantic-release/npm is 13.1.x, the version that added token-less trusted publishing. This is required: 24.x bundles 12.x (no OIDC), and semantic-release loads its own bundled copy, so adding @semantic-release/npm as a direct dep alone does not take effect. - .releaserc: swap the publisher plugin from semantic-release-yarn to @semantic-release/npm. - release.yml: add id-token: write, run on node 24 (ships npm >= 11.6, which OIDC needs), drop the NPM_TOKEN env, add a dry-run toggle. A local `semantic-release --dry-run` confirms it loads @semantic-release/npm 13.1.5 and computes 1.10.0. Requires a GitHub Actions trusted publisher to be configured for the package on npmjs.com before the next release.
MatiPl01
force-pushed
the
chore/oidc-trusted-publishing
branch
from
July 9, 2026 21:47
78ba207 to
009537a
Compare
Owner
Author
MatiPl01
added a commit
that referenced
this pull request
Jul 23, 2026
Moves npm publishing from the long-lived `NPM_TOKEN` to GitHub OIDC trusted publishing, so a release can't break again when the token expires (which is what happened on the last run). Provenance comes along for free. `semantic-release-yarn` can't do OIDC, so publishing goes back to `@semantic-release/npm` (13.1.x added trusted publishing). The workflow gains `id-token: write`, drops the token env, and gets a dry-run toggle. Stacked on #607. Before the next release, a trusted publisher needs to be set up once on npmjs.com for this repo + `release.yml`; then run the workflow with dry-run on to confirm auth, and delete the `NPM_TOKEN` secret. Supersedes #604.
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.
Moves publishing off a long-lived
NPM_TOKENand onto npm's OIDC trusted publishing, so a release can't break again from an expired or missing token (which is what just happened). Publishing also gets provenance automatically.Why the version bumps: token-less trusted publishing lives in
@semantic-release/npm13.1.x, and semantic-release loads its own bundled copy of that plugin - so the core has to move too.semantic-release24.x bundles the 12.x (no OIDC) plugin; 25.x bundles 13.1.x. Yarn'syarn npm publishcan't do OIDC at all, which is why the publisher swaps fromsemantic-release-yarnback to the first-party@semantic-release/npm.Changes:
semantic-release^25.0.5, publisher plugin@semantic-release/npmin.releaserc, andrelease.ymlgainsid-token: write, runs on node 24, dropsNPM_TOKEN, and adds a dry-run input. Rest of the pipeline is unchanged.Before this can publish (one manual step): configure a GitHub Actions trusted publisher for
react-native-sortableson npmjs.com (repoMatiPl01/react-native-sortables, workflowrelease.yml). Then run 🚀 Release with dry-run on to verify auth, then off to publish; delete theNPM_TOKENsecret afterwards.Validated locally with
semantic-release --dry-run: loads@semantic-release/npm13.1.5, runs the full pipeline under sr25, computes 1.10.0;yarn install --immutablepasses. The OIDC exchange itself is exercised by the dry-run workflow run.