7
7
8
8
jobs :
9
9
Build :
10
- if : ${{ !contains(github.event.head_commit.message, '[skip ci ]') }}
10
+ if : ${{ !contains(github.event.head_commit.message, '[skip build ]') }}
11
11
runs-on : ${{ matrix.os }}
12
12
# prettier-ignore
13
- name : ${{ matrix.os }}-${{ matrix.node_target_arch }}-${{ matrix.dockerfile }}-${{ matrix. distro }}-${{ matrix.base_image }}
13
+ name : ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.distro }}-${{ matrix.platform }}
14
14
strategy :
15
15
fail-fast : false
16
16
matrix :
17
17
os :
18
- - ubuntu-20 .04
18
+ - ubuntu-24 .04
19
19
- windows-2019
20
20
node_arch :
21
21
- x64
22
- node_target_arch :
23
- - x64
24
22
cpp_arch :
25
23
- x64
26
- dockerfile :
27
- - " "
28
24
distro :
29
25
- " "
30
- vm :
31
- - false
32
- cross_compiling :
33
- - false
26
+ native :
27
+ - true
28
+
34
29
include :
35
30
- os : windows-2019
36
31
node_arch : ia32
37
- node_target_arch : ia32
38
32
cpp_arch : amd64_x86
39
- vm : false
40
- cross_compiling : true
33
+ native : true
41
34
42
- - os : windows-2022
43
- node_arch : x64
44
- node_target_arch : arm64
45
- cpp_arch : amd64_arm64
46
- vm : false
47
- cross_compiling : true
35
+ # - os: windows-2022
36
+ # node_arch: x64
37
+ # arch: arm64
38
+ # cpp_arch: amd64_arm64
48
39
49
40
- os : macos-13
50
41
node_arch : x64
51
- node_target_arch : x64
52
42
cpp_arch : x64
53
- vm : false
54
- cross_compiling : false
43
+ native : true
55
44
56
45
- os : macos-14
57
46
node_arch : arm64
58
- node_target_arch : arm64
59
- cpp_arch : arm64
60
- vm : false
61
- cross_compiling : false
47
+ cpp_arch : amd64_arm64
48
+ native : true
62
49
63
- # Musl Alpine
50
+ # Ubuntu x64
64
51
- os : ubuntu-24.04
65
- dockerfile : docker/alpine.dockerfile
52
+ distro : ubuntu
53
+ platform : linux/amd64
66
54
node_arch : x64
67
- node_target_arch : x64
68
55
cpp_arch : x64
69
- vm : true
70
- cross_compiling : false
56
+ native : false
71
57
72
- # Debian Arm
73
- - os : ubuntu-24.04
74
- distro : none
75
- base_image : aminya/setup-cpp-ubuntu-gcc:20.04-1.3.0
58
+ # Ubuntu Arm
59
+ - os : ubuntu-24.04-arm
60
+ distro : ubuntu
61
+ platform : linux/arm64
76
62
node_arch : arm64
77
- node_target_arch : arm64
78
63
cpp_arch : arm64
79
- vm : true
80
- cross_compiling : false
64
+ native : false
81
65
82
- # Musl Alpine Arm
66
+ # Musl Alpine
83
67
- os : ubuntu-24.04
84
- distro : none
85
- base_image : aminya/setup-cpp-alpine-gcc:3.21-1.4.0-arm64
68
+ distro : alpine
69
+ platform : linux/amd64
70
+ node_arch : x64
71
+ cpp_arch : x64
72
+ native : false
73
+
74
+ # Musl Alpine Arm
75
+ - os : ubuntu-24.04-arm
76
+ distro : alpine
77
+ platform : linux/arm64
86
78
node_arch : arm64
87
- node_target_arch : arm64
88
79
cpp_arch : arm64
89
- vm : true
90
- cross_compiling : false
91
-
92
-
80
+ native : false
93
81
94
82
env :
95
83
npm_config_arch : ${{ matrix.node_arch }}
96
- npm_config_target_arch : ${{ matrix.node_target_arch }}
84
+ npm_config_target_arch : ${{ matrix.node_arch }}
97
85
setup_node_arch : ${{ matrix.node_arch }}
98
- cross_compiling : ${{ matrix.cross_compiling }}
99
86
steps :
100
87
- uses : actions/checkout@v4
101
88
@@ -118,8 +105,8 @@ jobs:
118
105
shell : bash
119
106
120
107
- name : Setup Cpp
121
- if : ${{ ! matrix.vm }}
122
- uses : aminya/setup-cpp@master
108
+ if : ${{ matrix.native }}
109
+ uses : aminya/setup-cpp@v1
123
110
with :
124
111
vcvarsall : ${{ contains(matrix.os, 'windows') }}
125
112
cmake : true
@@ -134,84 +121,67 @@ jobs:
134
121
brew install gnutls autoconf automake libtool
135
122
136
123
- uses : pnpm/action-setup@v4
137
- if : ${{ !matrix.vm }}
138
- with :
139
- version : 9
124
+ if : ${{ matrix.native }}
140
125
141
126
- name : Install Node 20
142
- if : ${{ ! matrix.vm }}
127
+ if : ${{ matrix.native }}
143
128
uses : actions/setup-node@v4
144
129
with :
145
130
node-version : 20
146
131
architecture : ${{ env.setup_node_arch }}
147
132
148
133
- name : Install and Build Native
149
- if : ${{ ! matrix.vm }}
134
+ if : ${{ matrix.native }}
150
135
run : pnpm install
151
136
152
137
- name : Build JavaScript
153
- if : ${{ ! matrix.vm }}
138
+ if : ${{ matrix.native }}
154
139
run : pnpm run build.js
155
140
156
141
- name : Install Node 12
157
- if : ${{ ! matrix.vm && matrix.os != 'macos-14' }}
142
+ if : ${{ matrix.native && matrix.os != 'macos-14' }}
158
143
uses : actions/setup-node@v4
159
144
with :
160
145
node-version : 12
161
146
architecture : ${{ env.setup_node_arch }}
162
147
163
- - name : Build Node 12 Native
164
- if : ${{ !matrix.vm }}
165
- run : node ./script/install.js
148
+ - name : Build Native
149
+ if : ${{ matrix.native && matrix.node_arch != 'ia32' }}
150
+ run : npm run build.native
151
+
152
+ - name : Build Native Windows 32
153
+ if : ${{ matrix.os == 'windows-2019' && matrix.node_arch == 'ia32' }}
154
+ run :
155
+ node --enable-source-maps ./node_modules/cmake-ts/build/main.js build --config win32-ia32-release
166
156
167
157
- name : Use Node 20
168
- if : ${{ ! matrix.vm }}
158
+ if : ${{ matrix.native }}
169
159
uses : actions/setup-node@v4
170
160
with :
171
161
node-version : 20
172
162
architecture : ${{ env.setup_node_arch }}
173
163
174
- - name : Prebuild Docker
175
- if : ${{ matrix.dockerfile }}
164
+ - name : Build Docker
165
+ if : ${{ matrix.distro }}
166
+ id : build_base
167
+ uses : docker/build-push-action@v6
168
+ with :
169
+ context : .
170
+ file : ./docker/${{ matrix.distro }}.dockerfile
171
+ push : false
172
+ load : true
173
+ provenance : false
174
+ platforms : ${{ matrix.platform }}
175
+ tags : zeromq:${{ matrix.distro }}-${{ matrix.node_arch }}
176
+
177
+ - name : Copy Build
178
+ if : ${{ matrix.distro }}
176
179
run : |
177
- docker build -t zeromq -f ${{ matrix.dockerfile }} .
178
- docker create --name zeromq-temp zeromq
180
+ docker create --name zeromq-temp zeromq:${{ matrix.distro }}-${{ matrix.node_arch }}
179
181
mkdir -p ./build
180
182
docker cp zeromq-temp:/app/build ./
181
183
docker rm -f zeromq-temp
182
184
183
- - name : Read Installer Script
184
- if : ${{ matrix.distro }}
185
- id : read-installer-script
186
- run : |
187
- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
188
- echo "install_deps<<$EOF" >> $GITHUB_OUTPUT
189
- cat ./script/install-deps.sh >> $GITHUB_OUTPUT
190
- echo "$EOF" >> $GITHUB_OUTPUT
191
-
192
- - name : Build Linux Arm64
193
- if : ${{ matrix.distro }}
194
-
195
- with :
196
- arch : aarch64
197
- distro : ${{ matrix.distro }}
198
- base_image : ${{ matrix.base_image }}
199
- githubToken : ${{ github.token }}
200
- setup : |
201
- mkdir -p "${PWD}/build"
202
- dockerRunArgs : |
203
- --volume "${PWD}/build:/build"
204
- shell : /bin/bash
205
- env : |
206
- VCPKG_FORCE_SYSTEM_BINARIES: 1
207
- install : |
208
- ${{ steps.read-installer-script.outputs.install_deps }}
209
-
210
- run : |
211
- (test -f $HOME/.cpprc && . $HOME/.cpprc || true) && \
212
- pnpm install && \
213
- pnpm run build
214
-
215
185
- name : Upload build
216
186
uses : actions/upload-artifact@v4
217
187
with :
@@ -220,11 +190,11 @@ jobs:
220
190
overwrite : true
221
191
222
192
- name : Lint
223
- if : " ${{ !matrix.vm && contains(matrix.os, 'ubuntu') }}"
193
+ if : " ${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
224
194
run : pnpm run lint-test
225
195
226
196
- name : Test
227
- if : ${{ ! matrix.vm }}
197
+ if : ${{ matrix.native }}
228
198
uses : nick-fields/retry@v3
229
199
with :
230
200
timeout_minutes : 5
@@ -235,7 +205,7 @@ jobs:
235
205
rm -rf ./tmp && mkdir -p ./tmp
236
206
237
207
- name : Test Electron Windows/MacOS
238
- if : " ${{ !matrix.vm && ! contains(matrix.os, 'ubuntu') }}"
208
+ if : " ${{ !contains(matrix.os, 'ubuntu') && matrix.native }}"
239
209
uses : nick-fields/retry@v3
240
210
with :
241
211
timeout_minutes : 5
@@ -245,7 +215,7 @@ jobs:
245
215
continue-on-error : true
246
216
247
217
- name : Test Electron Linux
248
- if : " ${{ !matrix.vm && contains(matrix.os, 'ubuntu') }}"
218
+ if : " ${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
249
219
uses : nick-fields/retry@v3
250
220
with :
251
221
timeout_minutes : 5
@@ -259,35 +229,31 @@ jobs:
259
229
runs-on : ubuntu-latest
260
230
needs : Build
261
231
steps :
262
- - name : Merge Artifacts
263
- uses : actions/upload-artifact/merge@v4
264
- with :
265
- name : build
266
- pattern : build-*
267
- delete-merged : true
268
-
269
232
- uses : actions/checkout@v4
270
233
271
- - name : Place build
272
- uses : actions/download-artifact@v4
273
- with :
274
- name : build
275
- path : ./build
276
-
277
234
- name : Install Node
278
235
uses : actions/setup-node@v4
279
236
with :
280
237
node-version-file : " ./.nvmrc"
281
238
282
239
- name : Install Pnpm
283
240
uses : pnpm/action-setup@v4
241
+
242
+ - name : Download Artifacts
243
+ uses : actions/download-artifact@v4
284
244
with :
285
- version : 9
245
+ pattern : build-*
246
+ path : ./build-artifacts
286
247
287
- - name : Pack Zeromq
248
+ - name : Install Dependencies
249
+ run : pnpm install
250
+
251
+ - name : Merge Artifacts
288
252
run : |
289
- pnpm install
290
- pnpm pack
253
+ pnpm exec tsx ./script/merge-artifacts.mts
254
+
255
+ - name : Pack Zeromq
256
+ run : pnpm pack
291
257
292
258
- name : Upload Pack
293
259
uses : actions/upload-artifact@v4
@@ -304,6 +270,9 @@ jobs:
304
270
matrix :
305
271
os :
306
272
- ubuntu-24.04
273
+ - ubuntu-22.04
274
+ - ubuntu-22.04-arm
275
+ - ubuntu-24.04-arm
307
276
- windows-2022
308
277
- macos-13
309
278
node-version :
0 commit comments