Skip to content

Commit 0fb22b5

Browse files
ci(root): align node versions across release and ci
Keep the compatibility matrix on explicit Node.js major lines. Use .nvmrc for the release gate and single-version CI jobs and cache keys. TICKET: WCN-2596
1 parent c0fc9cd commit 0fb22b5

2 files changed

Lines changed: 19 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ jobs:
205205
with:
206206
ref: ${{ github.event.pull_request.head.sha || github.sha }}
207207

208-
- name: Setup node 22
208+
- name: Setup node from .nvmrc
209209
uses: actions/setup-node@v6
210210
with:
211-
node-version: 22
211+
node-version-file: .nvmrc
212212

213213
- name: restore lerna dependencies
214214
id: lerna-cache
@@ -217,7 +217,7 @@ jobs:
217217
path: |
218218
node_modules
219219
modules/*/node_modules
220-
key: ${{ runner.os }}-node22-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('**/package.json') }}
220+
key: ${{ runner.os }}-node${{ hashFiles('.nvmrc') }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('**/package.json') }}
221221

222222
- name: Install Packages
223223
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
@@ -262,10 +262,10 @@ jobs:
262262
with:
263263
ref: ${{ github.event.pull_request.head.sha || github.sha }}
264264

265-
- name: Setup node 22
265+
- name: Setup node from .nvmrc
266266
uses: actions/setup-node@v6
267267
with:
268-
node-version: 22 # this just needs to pass our lock file requirement for compilation
268+
node-version-file: .nvmrc
269269

270270
- name: Build Info
271271
run: |
@@ -458,10 +458,10 @@ jobs:
458458
with:
459459
ref: ${{ github.event.pull_request.head.sha || github.sha }}
460460

461-
- name: Setup node 22
461+
- name: Setup node from .nvmrc
462462
uses: actions/setup-node@v6
463463
with:
464-
node-version: 22
464+
node-version-file: .nvmrc
465465

466466
- name: restore lerna dependencies
467467
id: lerna-cache
@@ -470,7 +470,7 @@ jobs:
470470
path: |
471471
node_modules
472472
modules/*/node_modules
473-
key: ${{ runner.os }}-node22-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json')}}-${{ hashFiles('**/package.json') }}
473+
key: ${{ runner.os }}-node${{ hashFiles('.nvmrc') }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json')}}-${{ hashFiles('**/package.json') }}
474474

475475
- name: Install Packages
476476
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')

.github/workflows/npmjs-release.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,13 @@ jobs:
308308
NPM_CONFIG_PROVENANCE: true
309309

310310
# WCN-2091: fail the release BEFORE bitgo publishes if the shrinkwrap it
311-
# would ship pins any transitive that violates our declared engines (Node
312-
# >=20). Runs after pass 1 because the shrinkwrap generator resolves
313-
# newly-published siblings from the registry. Pack + install here, not
314-
# --package-lock-only, so `engine-strict=true` actually validates every
315-
# frozen entry's engines. If this fails, siblings are already on npm but
316-
# bitgo isn't — fix the shrinkwrap issue and re-run in recovery-mode.
311+
# would ship pins any transitive that is incompatible with the Node.js
312+
# version pinned in .nvmrc. Runs after pass 1 because the shrinkwrap
313+
# generator resolves newly-published siblings from the registry. Pack +
314+
# install here, not --package-lock-only, so `engine-strict=true` actually
315+
# validates every frozen entry's engines. If this fails, siblings are
316+
# already on npm but bitgo isn't — fix the shrinkwrap issue and re-run in
317+
# recovery-mode.
317318
- name: Pre-publish shrinkwrap check — pack bitgo tarball
318319
if: inputs.dry-run == false
319320
env:
@@ -325,13 +326,13 @@ jobs:
325326
echo "PREPUB_TARBALL=$tarball" >> "$GITHUB_ENV"
326327
echo "Packed: $tarball"
327328
328-
- name: Pre-publish shrinkwrap check — setup Node 20
329+
- name: Pre-publish shrinkwrap check — setup Node.js from .nvmrc
329330
if: inputs.dry-run == false
330331
uses: actions/setup-node@v6
331332
with:
332-
node-version: '20.x'
333+
node-version-file: '.nvmrc'
333334

334-
- name: Pre-publish shrinkwrap check — install tarball on Node 20 with engine-strict
335+
- name: Pre-publish shrinkwrap check — install tarball on repository Node.js with engine-strict
335336
if: inputs.dry-run == false
336337
run: |
337338
workdir="$(mktemp -d)"
@@ -340,18 +341,12 @@ jobs:
340341
npm init -y >/dev/null
341342
echo "Verifying $PREPUB_TARBALL installs on $(node --version) with engine-strict=true"
342343
if ! npm install "$PREPUB_TARBALL" --no-audit --no-fund --ignore-scripts 2>install.log; then
343-
echo "::error::Pre-publish shrinkwrap check FAILED — bitgo tarball cannot be installed on Node 20 with engine-strict. Fix before publishing."
344+
echo "::error::Pre-publish shrinkwrap check FAILED — bitgo tarball cannot be installed on the repository Node.js version with engine-strict. Fix before publishing."
344345
cat install.log
345346
exit 1
346347
fi
347348
echo "✅ bitgo tarball installs cleanly on $(node --version) with engine-strict."
348349
349-
- name: Pre-publish shrinkwrap check — restore release Node version
350-
if: inputs.dry-run == false
351-
uses: actions/setup-node@v6
352-
with:
353-
node-version-file: ".nvmrc"
354-
355350
- name: Publish bitgo (pass 2)
356351
if: inputs.dry-run == false
357352
run: |

0 commit comments

Comments
 (0)