File tree 3 files changed +47
-34
lines changed
3 files changed +47
-34
lines changed Original file line number Diff line number Diff line change 1
- name : build
1
+ name : Build
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- master
7
- tags :
8
- - v*
9
7
pull_request :
10
8
branches :
11
9
- master
10
+ workflow_call :
12
11
13
12
concurrency :
14
13
group : ${{github.workflow}}-${{github.ref}}
15
14
cancel-in-progress : true
16
15
17
-
18
16
jobs :
19
17
test :
20
18
strategy :
21
19
matrix :
22
20
os :
23
- - windows-2022
24
- - macos-14
25
- - ubuntu-20.04
21
+ - windows-latest
22
+ - macos-latest
23
+ - ubuntu-latest
26
24
node :
27
25
- 18
28
26
- 20
27
+ - 22
29
28
fail-fast : false
30
29
name : Testing Node ${{ matrix.node }} on ${{ matrix.os }}
31
30
runs-on : ${{ matrix.os }}
@@ -37,38 +36,15 @@ jobs:
37
36
- uses : actions/setup-node@v4
38
37
with :
39
38
node-version : ${{ matrix.node }}
39
+
40
40
- run : npm install
41
- - run : npm run build -- --arch x64
42
- - run : npm run build -- --arch arm64
41
+ - run : npm run build_x64
42
+ - run : npm run build_arm64
43
43
- run : npm test
44
+
44
45
- uses : actions/upload-artifact@v4
45
46
if : github.ref_type == 'tag' && matrix.node == 20
46
47
with :
47
48
path : prebuilds/**
48
49
name : prebuilds-${{matrix.os}}
49
50
retention-days : 2
50
-
51
- publish :
52
- if : github.ref_type == 'tag'
53
- name : Publish to npm
54
- runs-on : ubuntu-20.04
55
- needs : [test]
56
- steps :
57
- - uses : actions/checkout@v4
58
- with :
59
- submodules : true
60
- fetch-depth : 0
61
- - uses : actions/setup-node@v4
62
- with :
63
- node-version : 20
64
- registry-url : https://registry.npmjs.org
65
- - uses : actions/download-artifact@v4
66
- with :
67
- path : prebuilds
68
- pattern : prebuilds-*
69
- merge-multiple : true
70
- - run : tree prebuilds
71
- - run : npm install
72
- - run : npm publish
73
- env :
74
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : Publish
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - v[0-9]+.[0-9]+.[0-9]+
7
+
8
+ jobs :
9
+ build :
10
+ uses : " ./.github/workflows/ci.yml"
11
+
12
+ publish :
13
+ if : github.ref_type == 'tag'
14
+ name : Publish to npm
15
+ runs-on : ubuntu-20.04
16
+ needs : [test]
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+ with :
20
+ submodules : true
21
+ fetch-depth : 0
22
+ - uses : actions/setup-node@v4
23
+ with :
24
+ node-version : 20
25
+ registry-url : https://registry.npmjs.org
26
+ - uses : actions/download-artifact@v4
27
+ with :
28
+ path : prebuilds
29
+ pattern : prebuilds-*
30
+ merge-multiple : true
31
+ - run : tree prebuilds
32
+ - run : npm install
33
+ - run : npm publish
34
+ env :
35
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 52
52
"scripts" : {
53
53
"install" : " node-gyp-build" ,
54
54
"build" : " prebuildify --napi --strip" ,
55
+ "build_x64" : " prebuildify --napi --strip --arch x64" ,
56
+ "build_arm64" : " prebuildify --napi --strip --arch arm64" ,
55
57
"rebuild" : " node-gyp rebuild" ,
56
58
"test" : " node --test test/**/*.js"
57
59
},
You can’t perform that action at this time.
0 commit comments