fix(core): update Node.js version to 22.16.0 since the rust-docker-lts version is not updated (#31547)

This PR updates the Nodejs version installed on our docker images
contained in the publish script to be consistent with the Nx repository
Node compatibility version.

The current Nodejs version being pulled from the docker image is Node
v18 but our repository requires Node v20.19.0.

A test run can be found here:
https://github.com/nrwl/nx/actions/runs/15593332649
This commit is contained in:
Nicholas Cunningham 2025-06-12 09:36:20 -06:00 committed by GitHub
parent 8ddd697a07
commit 4e187e1c35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ env:
DEBUG: napi:* DEBUG: napi:*
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }} NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
CYPRESS_INSTALL_BINARY: 0 CYPRESS_INSTALL_BINARY: 0
NODE_VERSION: 20.19.0 NODE_VERSION: 22.16.0
PNPM_VERSION: 10.11.1 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync) PNPM_VERSION: 10.11.1 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
jobs: jobs:
@ -140,23 +140,50 @@ jobs:
- host: ubuntu-latest - host: ubuntu-latest
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |- build: |
set -e && set -e
npm i -g pnpm@10.11.1 --force && apt-get update
pnpm --version &&
pnpm install --frozen-lockfile && curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
rustup target add aarch64-unknown-linux-gnu && apt-get install -y nodejs=22.16.0-1nodesource1
export PATH="/usr/local/bin:$PATH"
node --version
npm --version
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
pnpm install --frozen-lockfile
rustup target add x86_64-unknown-linux-gnu
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
- host: ubuntu-latest - host: ubuntu-latest
target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |- build: |
set -e && bash -c "
npm i -g pnpm@10.11.1 --force && set -e
pnpm --version && echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
pnpm install --frozen-lockfile && apk add --no-cache curl xz
rustup target add x86_64-unknown-linux-musl &&
curl -fsSL https://unofficial-builds.nodejs.org/download/release/v22.16.0/node-v22.16.0-linux-x64-musl.tar.xz -o node.tar.xz
tar -xJf node.tar.xz
mv node-v22.16.0-linux-x64-musl /usr/local/node
export PATH=\"/usr/local/node/bin:\$PATH\"
echo Node: \$(node -v)
echo NPM: \$(npm -v)
# Install PNPM
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
# Install deps and run native build
pnpm install --frozen-lockfile
rustup target add x86_64-unknown-linux-musl
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
"
- host: macos-13 - host: macos-13
target: aarch64-apple-darwin target: aarch64-apple-darwin
setup: |- setup: |-
@ -171,12 +198,22 @@ jobs:
- host: ubuntu-latest - host: ubuntu-latest
target: aarch64-unknown-linux-gnu target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |- build: |
set -e && set -e
npm i -g pnpm@10.11.1 --force && apt-get update
pnpm --version &&
pnpm install --frozen-lockfile && curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
rustup target add aarch64-unknown-linux-gnu && apt-get install -y nodejs=22.16.0-1nodesource1
export PATH="/usr/local/bin:$PATH"
node --version
npm --version
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
pnpm install --frozen-lockfile
rustup target add aarch64-unknown-linux-gnu
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
- host: ubuntu-latest - host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf target: armv7-unknown-linux-gnueabihf
@ -198,19 +235,36 @@ jobs:
- host: ubuntu-latest - host: ubuntu-latest
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |- build: |
set -e && bash -c "
rustup target add aarch64-unknown-linux-musl && set -e
npm i -g pnpm@10.11.1 --force && echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
pnpm --version && apk add --no-cache curl xz
pnpm install --frozen-lockfile &&
curl -fsSL https://unofficial-builds.nodejs.org/download/release/v22.16.0/node-v22.16.0-linux-x64-musl.tar.xz -o node.tar.xz
tar -xJf node.tar.xz
mv node-v22.16.0-linux-x64-musl /usr/local/node
export PATH=\"/usr/local/node/bin:\$PATH\"
echo Node: \$(node -v)
echo NPM: \$(npm -v)
# Install PNPM
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
# Install deps and run native build
pnpm install --frozen-lockfile
rustup target add aarch64-unknown-linux-musl
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
"
- host: windows-latest - host: windows-latest
target: aarch64-pc-windows-msvc target: aarch64-pc-windows-msvc
setup: |- setup: |-
rustup target add aarch64-pc-windows-msvc rustup target add aarch64-pc-windows-msvc
build: pnpm nx run-many --target=build-native -- --target=aarch64-pc-windows-msvc build: pnpm nx run-many --target=build-native -- --target=aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18 name: stable - ${{ matrix.settings.target }} - node@22.16.0
runs-on: ${{ matrix.settings.host }} runs-on: ${{ matrix.settings.host }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -318,11 +372,12 @@ jobs:
RUSTUP_IO_THREADS: 1 RUSTUP_IO_THREADS: 1
NX_PREFER_TS_NODE: true NX_PREFER_TS_NODE: true
PLAYWRIGHT_BROWSERS_PATH: 0 PLAYWRIGHT_BROWSERS_PATH: 0
NODE_VERSION: 22.16.0
with: with:
operating_system: freebsd operating_system: freebsd
version: '14.0' version: '14.0'
architecture: x86-64 architecture: x86-64
environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH NODE_VERSION
shell: bash shell: bash
run: | run: |
env env