@@ -10,19 +10,17 @@ jobs:
10
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_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
22
cpp_arch :
23
23
- x64
24
- dockerfile :
25
- - " "
26
24
distro :
27
25
- " "
28
26
native :
@@ -49,27 +47,36 @@ jobs:
49
47
cpp_arch : amd64_arm64
50
48
native : true
51
49
52
- # Musl Alpine
50
+ # Ubuntu x64
53
51
- os : ubuntu-24.04
54
- dockerfile : docker/alpine.dockerfile
52
+ distro : ubuntu
53
+ platform : linux/amd64
55
54
node_arch : x64
56
55
cpp_arch : x64
57
56
native : false
58
57
59
- # Debian Arm
60
- - os : ubuntu-24.04
58
+ # Ubuntu Arm
59
+ - os : ubuntu-24.04-arm
60
+ distro : ubuntu
61
+ platform : linux/arm64
61
62
node_arch : arm64
62
- cpp_arch : amd64_arm64
63
- distro : none
64
- base_image : aminya/setup-cpp-ubuntu-gcc:20.04-1.3.0
63
+ cpp_arch : arm64
65
64
native : false
66
65
67
- # Musl Alpine Arm
66
+ # Musl Alpine
68
67
- os : ubuntu-24.04
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
69
78
node_arch : arm64
70
- cpp_arch : amd64_arm64
71
- distro : none
72
- base_image : aminya/setup-cpp-alpine-gcc:3.21-1.4.0-arm64
79
+ cpp_arch : arm64
73
80
native : false
74
81
75
82
env :
@@ -154,47 +161,27 @@ jobs:
154
161
node-version : 20
155
162
architecture : ${{ env.setup_node_arch }}
156
163
157
- - name : Prebuild Docker
158
- 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 }}
159
179
run : |
160
- docker build -t zeromq -f ${{ matrix.dockerfile }} .
161
- docker create --name zeromq-temp zeromq
180
+ docker create --name zeromq-temp zeromq:${{ matrix.distro }}-${{ matrix.node_arch }}
162
181
mkdir -p ./build
163
182
docker cp zeromq-temp:/app/build ./
164
183
docker rm -f zeromq-temp
165
184
166
- - name : Read Installer Script
167
- if : ${{ matrix.distro }}
168
- id : read-installer-script
169
- run : |
170
- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
171
- echo "install_deps<<$EOF" >> $GITHUB_OUTPUT
172
- cat ./script/install-deps.sh >> $GITHUB_OUTPUT
173
- echo "$EOF" >> $GITHUB_OUTPUT
174
-
175
- - name : Build Linux Arm64
176
- if : ${{ matrix.distro }}
177
-
178
- with :
179
- arch : aarch64
180
- distro : ${{ matrix.distro }}
181
- base_image : ${{ matrix.base_image }}
182
- githubToken : ${{ github.token }}
183
- setup : |
184
- mkdir -p "${PWD}/build"
185
- dockerRunArgs : |
186
- --volume "${PWD}/build:/build"
187
- shell : /bin/bash
188
- env : |
189
- VCPKG_FORCE_SYSTEM_BINARIES: 1
190
- install : |
191
- ${{ steps.read-installer-script.outputs.install_deps }}
192
-
193
- run : |
194
- (test -f $HOME/.cpprc && . $HOME/.cpprc || true) && \
195
- pnpm install && \
196
- pnpm run build
197
-
198
185
- name : Upload build
199
186
uses : actions/upload-artifact@v4
200
187
with :
@@ -283,6 +270,9 @@ jobs:
283
270
matrix :
284
271
os :
285
272
- ubuntu-24.04
273
+ - ubuntu-22.04
274
+ - ubuntu-22.04-arm
275
+ - ubuntu-24.04-arm
286
276
- windows-2022
287
277
- macos-13
288
278
node-version :
0 commit comments