@@ -2,11 +2,9 @@ name: CI
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - master
5
+ branches : [master]
7
6
pull_request :
8
- branches :
9
- - master
7
+ branches : [master]
10
8
workflow_call :
11
9
12
10
concurrency :
@@ -18,58 +16,49 @@ jobs:
18
16
strategy :
19
17
matrix :
20
18
os :
21
- - windows-latest
22
- - macos-latest
19
+ - windows-2022
20
+ - windows-11-arm
21
+ - macos-15
22
+ - macos-13
23
23
- ubuntu-22.04
24
+ - ubuntu-22.04-arm
24
25
node :
25
- - 18
26
- - 20
27
- - 22
26
+ - 20.19.5
27
+ - 22.19.0
28
+ - 24.7.0
28
29
fail-fast : false
29
- name : Test Node ${{ matrix.node }} on ${{ matrix.os }}
30
- runs-on : ${{ matrix.os }}
30
+ name : Test Node ${{matrix.node}} on ${{matrix.os}}
31
+ runs-on : ${{matrix.os}}
31
32
defaults :
32
33
run :
33
34
shell : bash
34
35
steps :
35
36
- name : Checkout repository
36
- uses : actions/checkout@v4
37
+ uses : actions/checkout@v5
37
38
with :
38
39
submodules : true
39
- fetch-depth : 0
40
40
41
41
- name : Setup Node
42
- uses : actions/setup-node@v4
42
+ uses : actions/setup-node@v5
43
43
with :
44
- node-version : ${{ matrix.node }}
45
-
46
- - name : Install dependencies
47
- run : npm ci --legacy-peer-deps
44
+ node-version : ${{matrix.node}}
48
45
49
46
- name : Set npm_config_target
50
- run : echo "CONFIG_TARGET =${{ matrix.node == 22 && '22.12.0' || '20.9.0' }}" >> $GITHUB_ENV
47
+ run : printf 'npm_config_target =${{matrix.node}}\n' >> " $GITHUB_ENV"
51
48
52
- - name : Build x64 binary
53
- run : npm_config_target=${{ env.CONFIG_TARGET }} npm x -- prebuildify --napi --arch x64 -t 20.9.0
54
-
55
- - name : Set up cross-compilation
56
- if : runner.os == 'Linux'
57
- run : |-
58
- sudo apt-get update
59
- sudo apt-get install g++-aarch64-linux-gnu
60
- printf '%s\n' >> "$GITHUB_ENV" \
61
- 'CC=aarch64-linux-gnu-gcc' 'CXX=aarch64-linux-gnu-g++'
49
+ - name : Install dependencies
50
+ run : npm ci --legacy-peer-deps
62
51
63
- - name : Build arm64 binary
64
- run : npm_config_target=${{ env.CONFIG_TARGET }} npm x -- prebuildify --napi --arch arm64 -t 20.9.0
52
+ - name : Build binary
53
+ run : npm x -- prebuildify --napi
65
54
66
55
- name : Run tests
67
56
run : npm test
68
57
69
58
- name : Upload prebuilds
70
59
uses : actions/upload-artifact@v4
71
- if : github.ref_type == 'tag' && matrix.node == 20
60
+ if : github.ref_type == 'tag' && startsWith( matrix.node, '20')
72
61
with :
73
62
path : prebuilds/**
74
- name : prebuilds-${{matrix .os}}
63
+ name : prebuilds-${{runner .os}}-${{runner.arch }}
75
64
retention-days : 2
0 commit comments