99 Build :
1010 if : ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
1111 runs-on : ${{ matrix.os }}
12+ # prettier-ignore
13+ name : ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.dockerfile }}-${{ matrix.distro }}
1214 strategy :
1315 fail-fast : false
1416 matrix :
@@ -21,11 +23,16 @@ jobs:
2123 - x64
2224 dockerfile :
2325 - " "
26+ distro :
27+ - " "
28+ native :
29+ - true
2430
2531 include :
2632 - os : windows-2019
2733 node_arch : ia32
2834 cpp_arch : amd64_x86
35+ native : true
2936
3037 # - os: windows-2022
3138 # node_arch: x64
@@ -35,16 +42,33 @@ jobs:
3542 - os : macos-13
3643 node_arch : x64
3744 cpp_arch : x64
45+ native : true
3846
3947 - os : macos-14
4048 node_arch : arm64
4149 cpp_arch : amd64_arm64
50+ native : true
4251
43- # Alpine
44- - os : ubuntu-22 .04
52+ # Musl Alpine
53+ - os : ubuntu-24 .04
4554 dockerfile : docker/alpine.dockerfile
4655 node_arch : x64
4756 cpp_arch : x64
57+ native : false
58+
59+ # Debian Arm
60+ - os : ubuntu-24.04
61+ node_arch : arm64
62+ cpp_arch : amd64_arm64
63+ distro : bookworm
64+ native : false
65+
66+ # Musl Alpine Arm
67+ - os : ubuntu-24.04
68+ node_arch : arm64
69+ cpp_arch : amd64_arm64
70+ distro : alpine_latest
71+ native : false
4872
4973 env :
5074 npm_config_arch : ${{ matrix.node_arch }}
5983 path : |
6084 ./node_modules/
6185 ~/vcpkg
62- key :
63- # prettier-ignore
64- " cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-${{hashFiles('./pnpm-lock.yaml', './vcpkg.json', './CMakeLists.txt') }}"
86+ # prettier-ignore
87+ key : " cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-${{hashFiles('./pnpm-lock.yaml', './vcpkg.json', './CMakeLists.txt') }}"
6588 restore-keys : |
6689 "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-"
6790
7396 shell : bash
7497
7598 - name : Setup Cpp
76- if : ${{ ! matrix.dockerfile }}
99+ if : ${{ matrix.native }}
77100 uses : aminya/setup-cpp@v1
78101 with :
79102 vcvarsall : ${{ contains(matrix.os, 'windows') }}
@@ -89,34 +112,34 @@ jobs:
89112 brew install gnutls autoconf automake libtool
90113
91114 - uses : pnpm/action-setup@v4
92- if : ${{ ! matrix.dockerfile }}
115+ if : ${{ matrix.native }}
93116 with :
94117 version : 9
95118
96119 - name : Install Node 20
97- if : ${{ ! matrix.dockerfile }}
120+ if : ${{ matrix.native }}
98121 uses : actions/setup-node@v4
99122 with :
100123 node-version : 20
101124 architecture : ${{ env.setup_node_arch }}
102125
103126 - name : Install and Build Native
104- if : ${{ ! matrix.dockerfile }}
127+ if : ${{ matrix.native }}
105128 run : pnpm install
106129
107130 - name : Build JavaScript
108- if : ${{ ! matrix.dockerfile }}
131+ if : ${{ matrix.native }}
109132 run : pnpm run build.js
110133
111134 - name : Install Node 10
112- if : ${{ ! matrix.dockerfile && matrix.os != 'macos-14' }}
135+ if : ${{ matrix.native && matrix.os != 'macos-14' }}
113136 uses : actions/setup-node@v4
114137 with :
115138 node-version : 10
116139 architecture : ${{ env.setup_node_arch }}
117140
118141 - name : Build Native
119- if : ${{ ! matrix.dockerfile && matrix.node_arch != 'ia32' }}
142+ if : ${{ matrix.native && matrix.node_arch != 'ia32' }}
120143 run : npm run build.native
121144
122145 - name : Build Native Windows 32
@@ -126,7 +149,7 @@ jobs:
126149 windows-x86
127150
128151 - name : Use Node 20
129- if : ${{ ! matrix.dockerfile }}
152+ if : ${{ matrix.native }}
130153 uses : actions/setup-node@v4
131154 with :
132155 node-version : 20
@@ -137,9 +160,39 @@ jobs:
137160 run : |
138161 docker build -t zeromq -f ${{ matrix.dockerfile }} .
139162 docker create --name zeromq-temp zeromq
140- docker cp zeromq-temp:/app/build ./build
163+ mkdir -p ./build
164+ docker cp zeromq-temp:/app/build ./
141165 docker rm -f zeromq-temp
142166
167+ - name : Read Installer Script
168+ if : ${{ matrix.distro }}
169+ id : read-installer-script
170+ run : |
171+ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
172+ echo "install_deps<<$EOF" >> $GITHUB_OUTPUT
173+ cat ./script/install-deps.sh >> $GITHUB_OUTPUT
174+ echo "$EOF" >> $GITHUB_OUTPUT
175+
176+ - name : Build Linux Arm64
177+ if : ${{ matrix.distro }}
178+ uses : uraimo/run-on-arch-action@v2.8.1
179+ with :
180+ arch : aarch64
181+ distro : ${{ matrix.distro }}
182+ githubToken : ${{ github.token }}
183+ setup : |
184+ mkdir -p "${PWD}/build"
185+ dockerRunArgs : |
186+ --volume "${PWD}/build:/build"
187+ env : |
188+ VCPKG_FORCE_SYSTEM_BINARIES: 1
189+ install : |
190+ ${{ steps.read-installer-script.outputs.install_deps }}
191+
192+ run : |
193+ pnpm install && \
194+ pnpm run build
195+
143196 - name : Upload build
144197 uses : actions/upload-artifact@v4
145198 with :
@@ -148,11 +201,11 @@ jobs:
148201 overwrite : true
149202
150203 - name : Lint
151- if : " ${{ contains(matrix.os, 'ubuntu') && ! matrix.dockerfile }}"
204+ if : " ${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
152205 run : pnpm run lint-test
153206
154207 - name : Test
155- if : ${{ ! matrix.dockerfile }}
208+ if : ${{ matrix.native }}
156209 uses : nick-fields/retry@v3
157210 with :
158211 timeout_minutes : 5
@@ -163,7 +216,7 @@ jobs:
163216 rm -rf ./tmp && mkdir -p ./tmp
164217
165218 - name : Test Electron Windows/MacOS
166- if : " ${{ !contains(matrix.os, 'ubuntu') && ! matrix.dockerfile }}"
219+ if : " ${{ !contains(matrix.os, 'ubuntu') && matrix.native }}"
167220 uses : nick-fields/retry@v3
168221 with :
169222 timeout_minutes : 5
@@ -173,7 +226,7 @@ jobs:
173226 continue-on-error : true
174227
175228 - name : Test Electron Linux
176- if : " ${{ contains(matrix.os, 'ubuntu') && ! matrix.dockerfile }}"
229+ if : " ${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
177230 uses : nick-fields/retry@v3
178231 with :
179232 timeout_minutes : 5
0 commit comments