Skip to content

Commit aab1a90

Browse files
committed
Update GitHub workflows
Some of these had hardcoded versions (e.g. v18) Also reworks prebuild action to not require a 3x3 matrix.
1 parent b1d9a29 commit aab1a90

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ on: [push, pull_request]
44

55
jobs:
66
build-and-test:
7+
name: ${{ matrix.os }} / Node ${{ matrix.node }}
78
runs-on: ${{ matrix.os }}
89
strategy:
910
matrix:
10-
node-version: [ 18.x, 20.x, 22.x ]
1111
os: [ ubuntu-latest, macos-latest, windows-latest ]
12+
node: [ 18, 20, 22 ]
1213
fail-fast: false
1314
steps:
1415
- uses: actions/checkout@v4
15-
- name: Use Node.js ${{ matrix.node-version }}
16+
- name: Use Node.js ${{ matrix.node }}
1617
uses: actions/setup-node@v4
1718
with:
18-
node-version: ${{ matrix.node-version }}
19+
node-version: ${{ matrix.node }}
1920
- name: Add msbuild to PATH
2021
if: matrix.os == 'windows-latest'
2122
uses: microsoft/setup-msbuild@v1.3
@@ -39,8 +40,9 @@ jobs:
3940
runs-on: ubuntu-latest
4041
strategy:
4142
matrix:
42-
node-version: [ 18, 20, 22 ]
43-
container: node:${{ matrix.node-version }}-alpine
43+
node: [ 18, 20, 22 ]
44+
fail-fast: false
45+
container: node:${{ matrix.node }}-alpine
4446
steps:
4547
- uses: actions/checkout@v4
4648
- name: install build deps

.github/workflows/prebuild.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,61 @@ on:
77

88
jobs:
99
prebuild:
10+
name: ${{ matrix.os }}
1011
runs-on: ${{ matrix.os }}
1112
strategy:
1213
matrix:
13-
node-version: [ 18.x, 20.x, 22.x ]
1414
os: [ ubuntu-latest, macos-latest, windows-latest ]
15-
fail-fast: false
1615
steps:
1716
- uses: actions/checkout@v4
18-
- name: Use Node.js 18.x
17+
- name: Use nodejs
1918
uses: actions/setup-node@v4
2019
with:
21-
node-version: 18.x
20+
node-version: latest
2221
- name: Add msbuild to PATH
2322
if: matrix.os == 'windows-latest'
2423
uses: microsoft/setup-msbuild@v1.3
2524
- name: Install node-gyp
2625
if: matrix.os == 'windows-latest'
2726
run: |
2827
npm install --global node-gyp@latest
29-
- name: Build
28+
- name: Dependencies
3029
run: |
3130
npm install --ignore-scripts
32-
- name: Prebuild
31+
- name: Build
3332
run: |
34-
npm run prebuild
33+
npx prebuild --target 18.0.0
34+
npx prebuild --target 20.0.0
35+
npx prebuild --target 22.0.0
3536
- name: Upload
3637
run: |
37-
npx prebuild --upload ${{ secrets.UPLOAD_TOKEN }}
38+
npx prebuild --upload-all ${{ secrets.UPLOAD_TOKEN }}
3839
env:
3940
MAKEFLAGS: -j4
4041

4142
prebuild-alpine:
43+
name: alpine
4244
runs-on: ubuntu-latest
43-
container: node:18-alpine3.19
45+
container: node:alpine
4446
steps:
4547
- uses: actions/checkout@v4
46-
- name: install build deps
48+
- name: Use nodejs
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: latest
52+
- name: Install build deps
4753
run: |
4854
apk add g++ make python3
49-
- name: Build
55+
- name: Dependencies
5056
run: |
5157
npm install --ignore-scripts
52-
- name: Prebuild
58+
- name: Build
5359
run: |
54-
npm run prebuild
60+
npx prebuild --target 18.0.0
61+
npx prebuild --target 20.0.0
62+
npx prebuild --target 22.0.0
5563
- name: Upload
5664
run: |
57-
npx prebuild --upload ${{ secrets.UPLOAD_TOKEN }}
65+
npx prebuild --upload-all ${{ secrets.UPLOAD_TOKEN }}
5866
env:
5967
MAKEFLAGS: -j4

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"scripts": {
1111
"install": "prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)",
1212
"rebuild": "node-gyp rebuild --release -j max",
13-
"prebuild": "prebuild",
14-
"upload": "prebuild --upload ${GITHUB_TOKEN}",
1513
"lint": "find src -name '*.cc' | xargs -n1 clang-tidy",
1614
"test": "node test.js"
1715
},

0 commit comments

Comments
 (0)