Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,23 @@ jobs:
- name: Install a working npm (bundled npm in Node 22.22.2 is broken)
# Node 22.22.2 ships with an npm install that is missing the
# `promise-retry` dependency, so `npm install -g npm@latest` fails
# with MODULE_NOT_FOUND before it can upgrade itself. Use corepack
# to install a known-good npm version that supports OIDC trusted
# publishing.
# with MODULE_NOT_FOUND before it can upgrade itself. Corepack's
# `prepare --activate` stages a new npm in the corepack cache but
# does not actually replace the npm binary in the PATH that this
# shell sees (it prints the old version). Instead, download the
# npm@11.6.0 tarball directly and extract it over the broken
# bundled install. npm 11.6.0 supports OIDC trusted publishing.
run: |
corepack enable
corepack prepare npm@11.6.0 --activate
set -euo pipefail
NODE_BIN=$(which node)
NODE_DIR=$(dirname $(dirname $NODE_BIN))
NPM_DIR="$NODE_DIR/lib/node_modules/npm"
TMP=$(mktemp -d)
curl -fsSL https://registry.npmjs.org/npm/-/npm-11.6.0.tgz -o "$TMP/npm.tgz"
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
tar -xzf "$TMP/npm.tgz" -C "$TMP"
sudo rm -rf "$NPM_DIR"
sudo mv "$TMP/package" "$NPM_DIR"
hash -r
npm --version

- name: Install dependencies
Expand Down
Loading