Skip to content

Commit b1e6d73

Browse files
Tighten engines and devEngines
`engines` requires `node` version `>=22.11.0` instead of `>=22`, while `22.11.0` is first long term support minor version of this major version. `devEngines` requires `node` version `^22.11.0 || ^24.11.0` instead of `22.x || 24.x`, while `22.11.0` and `24.11.0` are first long term support minor versions of those major versions. `devEngines` now requires `npm` version `^11.6.1` as it is first `npm` version delivered by `node` in version `24.11.0`. We require single major version of `npm` to generate `package-lock.json` of compatible structure. This would not be possible without requiring specific version of `npm`.
1 parent 32c6c9b commit b1e6d73

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,34 @@ name: Build
22

33
on: [ pull_request ]
44

5+
env:
6+
NODE_ACTIVE_LTS_VERSION: 24
7+
NODE_PREVIOUS_LTS_VERSION: 22
8+
NPM_VERSION: 11
9+
510
jobs:
11+
prepare_env:
12+
name: Prepare environment
13+
runs-on: ubuntu-24.04
14+
outputs:
15+
NODE_ACTIVE_LTS_VERSION: ${{ env.NODE_ACTIVE_LTS_VERSION }}
16+
NODE_PREVIOUS_LTS_VERSION: ${{ env.NODE_PREVIOUS_LTS_VERSION }}
17+
NPM_VERSION: ${{ env.NPM_VERSION }}
18+
steps:
19+
- name: Compute outputs
20+
run: |
21+
echo "NODE_ACTIVE_LTS_VERSION=${{ env.NODE_ACTIVE_LTS_VERSION }}" >> $GITHUB_OUTPUT
22+
echo "NODE_PREVIOUS_LTS_VERSION=${{ env.NODE_PREVIOUS_LTS_VERSION }}" >> $GITHUB_OUTPUT
23+
echo "NPM_VERSION=${{ env.NPM_VERSION }}" >> $GITHUB_OUTPUT
624
build:
725
name: Build distribution CSS and JS
826
runs-on: ubuntu-24.04
27+
needs: prepare_env
928
strategy:
1029
matrix:
11-
node: [ 22, 24 ]
30+
node:
31+
- ${{ needs.prepare_env.outputs.NODE_ACTIVE_LTS_VERSION }}
32+
- ${{ needs.prepare_env.outputs.NODE_PREVIOUS_LTS_VERSION }}
1233
steps:
1334
- name: Clone repository
1435
uses: actions/checkout@v6
@@ -18,19 +39,19 @@ jobs:
1839
with:
1940
node-version: ${{ matrix.node }}
2041
cache: npm
21-
if: matrix.node != 22
42+
if: matrix.node == env.NODE_ACTIVE_LTS_VERSION
2243

2344
- name: Set up Node.js ${{ matrix.node }}
24-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@v6
2546
with:
2647
node-version: ${{ matrix.node }}
2748
cache: npm
28-
if: matrix.node == 22
49+
if: matrix.node == env.NODE_PREVIOUS_LTS_VERSION
2950
continue-on-error: true
3051

3152
- name: Install npm@11 for Node.js ${{ matrix.node }}
32-
run: npm install npm@11
33-
if: matrix.node == 22
53+
run: npm install -g npm@${{ env.NPM_VERSION }}
54+
if: matrix.node == env.NODE_PREVIOUS_LTS_VERSION
3455

3556
- name: Print Node.js and npm version
3657
run: node --version && npm --version

0 commit comments

Comments
 (0)