Skip to content

Commit 2a8f826

Browse files
committed
Merge branch 'master' into windows-arm
2 parents 70d42cd + 9a327fa commit 2a8f826

14 files changed

+526
-403
lines changed

.github/workflows/CI.yml

Lines changed: 88 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -7,95 +7,82 @@ on:
77

88
jobs:
99
Build:
10-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
10+
if: ${{ !contains(github.event.head_commit.message, '[skip build]') }}
1111
runs-on: ${{ matrix.os }}
1212
# 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 }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
1717
os:
18-
- ubuntu-20.04
18+
- ubuntu-24.04
1919
- windows-2019
2020
node_arch:
2121
- x64
22-
node_target_arch:
23-
- x64
2422
cpp_arch:
2523
- x64
26-
dockerfile:
27-
- ""
2824
distro:
2925
- ""
30-
vm:
31-
- false
32-
cross_compiling:
33-
- false
26+
native:
27+
- true
28+
3429
include:
3530
- os: windows-2019
3631
node_arch: ia32
37-
node_target_arch: ia32
3832
cpp_arch: amd64_x86
39-
vm: false
40-
cross_compiling: true
33+
native: true
4134

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
4839

4940
- os: macos-13
5041
node_arch: x64
51-
node_target_arch: x64
5242
cpp_arch: x64
53-
vm: false
54-
cross_compiling: false
43+
native: true
5544

5645
- os: macos-14
5746
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
6249

63-
# Musl Alpine
50+
# Ubuntu x64
6451
- os: ubuntu-24.04
65-
dockerfile: docker/alpine.dockerfile
52+
distro: ubuntu
53+
platform: linux/amd64
6654
node_arch: x64
67-
node_target_arch: x64
6855
cpp_arch: x64
69-
vm: true
70-
cross_compiling: false
56+
native: false
7157

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
7662
node_arch: arm64
77-
node_target_arch: arm64
7863
cpp_arch: arm64
79-
vm: true
80-
cross_compiling: false
64+
native: false
8165

82-
# Musl Alpine Arm
66+
# Musl Alpine
8367
- 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
8678
node_arch: arm64
87-
node_target_arch: arm64
8879
cpp_arch: arm64
89-
vm: true
90-
cross_compiling: false
91-
92-
80+
native: false
9381

9482
env:
9583
npm_config_arch: ${{ matrix.node_arch }}
96-
npm_config_target_arch: ${{ matrix.node_target_arch }}
84+
npm_config_target_arch: ${{ matrix.node_arch }}
9785
setup_node_arch: ${{ matrix.node_arch }}
98-
cross_compiling: ${{ matrix.cross_compiling }}
9986
steps:
10087
- uses: actions/checkout@v4
10188

@@ -118,8 +105,8 @@ jobs:
118105
shell: bash
119106

120107
- name: Setup Cpp
121-
if: ${{ !matrix.vm }}
122-
uses: aminya/setup-cpp@master
108+
if: ${{ matrix.native }}
109+
uses: aminya/setup-cpp@v1
123110
with:
124111
vcvarsall: ${{ contains(matrix.os, 'windows') }}
125112
cmake: true
@@ -134,84 +121,67 @@ jobs:
134121
brew install gnutls autoconf automake libtool
135122
136123
- uses: pnpm/action-setup@v4
137-
if: ${{ !matrix.vm }}
138-
with:
139-
version: 9
124+
if: ${{ matrix.native }}
140125

141126
- name: Install Node 20
142-
if: ${{ !matrix.vm }}
127+
if: ${{ matrix.native }}
143128
uses: actions/setup-node@v4
144129
with:
145130
node-version: 20
146131
architecture: ${{ env.setup_node_arch }}
147132

148133
- name: Install and Build Native
149-
if: ${{ !matrix.vm }}
134+
if: ${{ matrix.native }}
150135
run: pnpm install
151136

152137
- name: Build JavaScript
153-
if: ${{ !matrix.vm }}
138+
if: ${{ matrix.native }}
154139
run: pnpm run build.js
155140

156141
- name: Install Node 12
157-
if: ${{ !matrix.vm && matrix.os != 'macos-14' }}
142+
if: ${{ matrix.native && matrix.os != 'macos-14' }}
158143
uses: actions/setup-node@v4
159144
with:
160145
node-version: 12
161146
architecture: ${{ env.setup_node_arch }}
162147

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
166156

167157
- name: Use Node 20
168-
if: ${{ !matrix.vm }}
158+
if: ${{ matrix.native }}
169159
uses: actions/setup-node@v4
170160
with:
171161
node-version: 20
172162
architecture: ${{ env.setup_node_arch }}
173163

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 }}
176179
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 }}
179181
mkdir -p ./build
180182
docker cp zeromq-temp:/app/build ./
181183
docker rm -f zeromq-temp
182184
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-
uses: uraimo/[email protected]
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-
215185
- name: Upload build
216186
uses: actions/upload-artifact@v4
217187
with:
@@ -220,11 +190,11 @@ jobs:
220190
overwrite: true
221191

222192
- name: Lint
223-
if: "${{ !matrix.vm && contains(matrix.os, 'ubuntu') }}"
193+
if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
224194
run: pnpm run lint-test
225195

226196
- name: Test
227-
if: ${{ !matrix.vm }}
197+
if: ${{ matrix.native }}
228198
uses: nick-fields/retry@v3
229199
with:
230200
timeout_minutes: 5
@@ -235,7 +205,7 @@ jobs:
235205
rm -rf ./tmp && mkdir -p ./tmp
236206
237207
- name: Test Electron Windows/MacOS
238-
if: "${{ !matrix.vm && !contains(matrix.os, 'ubuntu') }}"
208+
if: "${{ !contains(matrix.os, 'ubuntu') && matrix.native }}"
239209
uses: nick-fields/retry@v3
240210
with:
241211
timeout_minutes: 5
@@ -245,7 +215,7 @@ jobs:
245215
continue-on-error: true
246216

247217
- name: Test Electron Linux
248-
if: "${{ !matrix.vm && contains(matrix.os, 'ubuntu') }}"
218+
if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
249219
uses: nick-fields/retry@v3
250220
with:
251221
timeout_minutes: 5
@@ -259,35 +229,31 @@ jobs:
259229
runs-on: ubuntu-latest
260230
needs: Build
261231
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-
269232
- uses: actions/checkout@v4
270233

271-
- name: Place build
272-
uses: actions/download-artifact@v4
273-
with:
274-
name: build
275-
path: ./build
276-
277234
- name: Install Node
278235
uses: actions/setup-node@v4
279236
with:
280237
node-version-file: "./.nvmrc"
281238

282239
- name: Install Pnpm
283240
uses: pnpm/action-setup@v4
241+
242+
- name: Download Artifacts
243+
uses: actions/download-artifact@v4
284244
with:
285-
version: 9
245+
pattern: build-*
246+
path: ./build-artifacts
286247

287-
- name: Pack Zeromq
248+
- name: Install Dependencies
249+
run: pnpm install
250+
251+
- name: Merge Artifacts
288252
run: |
289-
pnpm install
290-
pnpm pack
253+
pnpm exec tsx ./script/merge-artifacts.mts
254+
255+
- name: Pack Zeromq
256+
run: pnpm pack
291257

292258
- name: Upload Pack
293259
uses: actions/upload-artifact@v4
@@ -304,6 +270,9 @@ jobs:
304270
matrix:
305271
os:
306272
- ubuntu-24.04
273+
- ubuntu-22.04
274+
- ubuntu-22.04-arm
275+
- ubuntu-24.04-arm
307276
- windows-2022
308277
- macos-13
309278
node-version:

.github/workflows/docs.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77

88
jobs:
99
Docs:
10-
runs-on: ubuntu-22.04
10+
runs-on: ${{ matrix.os }}
1111
strategy:
1212
fail-fast: false
1313
matrix:
1414
os:
15-
- ubuntu-22.04
15+
- ubuntu-24.04
1616
node_version:
17-
- 18
17+
- 20
1818
node_arch:
1919
- x64
2020
cpp_arch:
@@ -55,8 +55,6 @@ jobs:
5555
architecture: ${{ matrix.cpp_arch }}
5656

5757
- uses: pnpm/action-setup@v4
58-
with:
59-
version: 9
6058

6159
- name: Install Node
6260
uses: actions/setup-node@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ compile_commands.json
2929

3030
/smoke-test-*
3131
/*.tgz
32+
/build-artifacts

0 commit comments

Comments
 (0)