Skip to content

fix(release): use Node 24 bundled npm for OIDC publish, drop global npm upgrade#306

Merged
garrity-miepub merged 1 commit into
mainfrom
fix/release-node24-bundled-npm
Jul 9, 2026
Merged

fix(release): use Node 24 bundled npm for OIDC publish, drop global npm upgrade#306
garrity-miepub merged 1 commit into
mainfrom
fix/release-node24-bundled-npm

Conversation

@garrity-miepub

Copy link
Copy Markdown
Collaborator

Problem

Third in the series (#304#305 → this). Run #163 (first on the Node 22 + npm install -g npm@latest config from #305) finally reached Publish to npm and produced a new error:

npm error code MODULE_NOT_FOUND
npm error Cannot find module 'sigstore'
npm error Require stack:
npm error - .../npm/node_modules/libnpmpublish/lib/provenance.js

npm 12 did install (the version-check steps passed), but globally upgrading npm on the runner's hostedtoolcache left a broken dependency tree — the bundled sigstore module (needed by --provenance) was missing. This is a known fragility of npm install -g npm@latest on top of the preinstalled npm.

Fix

Stop upgrading npm globally. Instead pick a Node version whose bundled npm already meets our needs:

  • Switch node-version 22 → 24 (Active LTS "Krypton").
  • Remove the Upgrade npm step entirely.

Node 24's bundled npm is 11.x (24.18.0 → npm 11.16.0; every 24.7.0+ ships npm ≥ 11.5.1), which:

  • ✅ supports tokenless OIDC Trusted Publishing (needs npm ≥ 11.5.1), and
  • ✅ has an intact dependency tree (sigstore present) because it's the bundled npm, not a re-installed one.

One change satisfies both constraints that tripped up the previous two attempts.

Full history

Node npm Install OIDC publish provenance/sigstore
#160/#161 20 -g → 12 ❌ needs Node ≥22
#304 (run #162) 22 bundled 10.9 ❌ needs ≥11.5.1
#305 (run #163) 22 -g → 12 ❌ broken tree, no sigstore
This PR 24 bundled 11.16

Scope / risk

  • CI-only — one file, .github/workflows/release.yml (+7/−13; the fragile global-upgrade step is deleted). No src/, deps, or exports touched.

After merge

Merge to main triggers the Release workflow; the publish step should authenticate via OIDC with a healthy npm and land 0.6.1-dev.<run#> on @next.

…pm upgrade

Run #163 reached 'Publish to npm' then failed:
  npm error Cannot find module 'sigstore'
from libnpmpublish/lib/provenance.js. The 'npm install -g npm@latest' step
left a broken npm dependency tree on the runner (missing bundled sigstore),
which breaks 'npm publish --provenance'.

Switch to Node 24 (Active LTS), whose bundled npm is 11.x (>=11.5.1): it
supports tokenless OIDC Trusted Publishing AND has an intact tree with
sigstore present. Remove the global npm upgrade entirely -- it was the source
of the broken tree. One change satisfies both the OIDC-version and
provenance-deps requirements.
Copilot AI review requested due to automatic review settings July 9, 2026 01:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Release GitHub Actions workflow to avoid a fragile global npm upgrade during publishing by switching to a Node version whose bundled npm already supports OIDC Trusted Publishing with --provenance.

Changes:

  • Bump actions/setup-node from Node 22 → 24 to use Node 24’s bundled npm (>= 11.5.1) for tokenless OIDC Trusted Publishing.
  • Remove the global npm install -g npm@latest upgrade step (and its follow-up version check) to avoid breaking npm’s dependency tree on the runner.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f8c23d
Status: ✅  Deploy successful!
Preview URL: https://921dae7a.ui-6d0.pages.dev
Branch Preview URL: https://fix-release-node24-bundled-n.ui-6d0.pages.dev

View logs

@garrity-miepub garrity-miepub merged commit ce5da9d into main Jul 9, 2026
11 checks passed
@garrity-miepub garrity-miepub deleted the fix/release-node24-bundled-npm branch July 9, 2026 02:08
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.

2 participants