Skip to content

Commit 34ebeb4

Browse files
Copilotfregante
andcommitted
Add actions/setup-node with node-version-file to all workflow jobs
- Added actions/setup-node@v4 with node-version-file: package.json to ci.yml Build job - Added actions/setup-node@v4 with node-version-file: artifact/package.json to all esm-lint.yml jobs that run npm/npx commands - Added actions/setup-node@v4 with node-version-file: package.json to demo.yml build job - Ensures all jobs use the correct Node version as specified in package.json engines field Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
1 parent 0513c34 commit 34ebeb4

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- uses: actions/checkout@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version-file: package.json
3235
- run: npm ci
3336
- run: npm run build
3437
- name: Ensure that test URLs aren't included in the built file

.github/workflows/demo.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version-file: package.json
1922
- run: npm ci
2023
- run: npm run build:demo
2124
- run: npm run test:demo

.github/workflows/esm-lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version-file: package.json
2225
- run: npm install
2326
- run: npm run build --if-present
2427
- run: npm pack --dry-run
@@ -31,12 +34,18 @@ jobs:
3134
needs: Pack
3235
steps:
3336
- uses: actions/download-artifact@v4
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version-file: artifact/package.json
3440
- run: npx publint ./artifact
3541
Webpack:
3642
runs-on: ubuntu-latest
3743
needs: Pack
3844
steps:
3945
- uses: actions/download-artifact@v4
46+
- uses: actions/setup-node@v4
47+
with:
48+
node-version-file: artifact/package.json
4049
- run: npm install --omit=dev ./artifact
4150
- run: echo "$IMPORT_STATEMENT" > index.js
4251
- run: webpack --entry ./index.js
@@ -46,6 +55,9 @@ jobs:
4655
needs: Pack
4756
steps:
4857
- uses: actions/download-artifact@v4
58+
- uses: actions/setup-node@v4
59+
with:
60+
node-version-file: artifact/package.json
4961
- run: npm install --omit=dev ./artifact
5062
- run: echo "$IMPORT_STATEMENT" > index.js
5163
- run: >
@@ -58,6 +70,9 @@ jobs:
5870
needs: Pack
5971
steps:
6072
- uses: actions/download-artifact@v4
73+
- uses: actions/setup-node@v4
74+
with:
75+
node-version-file: artifact/package.json
6176
- run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-json @rollup/plugin-node-resolve
6277
- run: echo "$IMPORT_STATEMENT" > index.js
6378
- run: npx rollup -p node-resolve -p @rollup/plugin-json index.js
@@ -66,6 +81,9 @@ jobs:
6681
needs: Pack
6782
steps:
6883
- uses: actions/download-artifact@v4
84+
- uses: actions/setup-node@v4
85+
with:
86+
node-version-file: artifact/package.json
6987
- run: npm install --omit=dev ./artifact
7088
- run: echo '<script type="module">$IMPORT_STATEMENT</script>' > index.html
7189
- run: npx vite build
@@ -75,6 +93,9 @@ jobs:
7593
needs: Pack
7694
steps:
7795
- uses: actions/download-artifact@v4
96+
- uses: actions/setup-node@v4
97+
with:
98+
node-version-file: artifact/package.json
7899
- run: echo '{}' > package.json
79100
- run: echo "$IMPORT_STATEMENT" > index.js
80101
- run: npm install --omit=dev ./artifact
@@ -84,6 +105,9 @@ jobs:
84105
needs: Pack
85106
steps:
86107
- uses: actions/download-artifact@v4
108+
- uses: actions/setup-node@v4
109+
with:
110+
node-version-file: artifact/package.json
87111
- run: echo '{"type":"module"}' > package.json
88112
- run: npm install --omit=dev ./artifact @sindresorhus/tsconfig
89113
- run: echo "$IMPORT_STATEMENT" > index.ts

0 commit comments

Comments
 (0)