@@ -45,19 +45,30 @@ jobs:
45
45
python -m pip install meson
46
46
yarn workspace @napi-rs/image build --target x86_64-pc-windows-msvc --features with_simd
47
47
target : x86_64-pc-windows-msvc
48
+ - host : macos-latest
49
+ target : aarch64-pc-windows-msvc
50
+ setup : |
51
+ brew update
52
+ brew install meson llvm
53
+ build : |
54
+ export XWIN_CACHE_DIR="$(pwd)/.xwin"
55
+ export XWIN_ARCH=aarch64
56
+ export PATH="$(brew --prefix llvm)/bin:$PATH"
57
+ clang --version
58
+ CFLAGS="-mneon /FIintrin.h" yarn workspace @napi-rs/image build -x --features with_simd --target aarch64-pc-windows-msvc
48
59
- host : macos-latest
49
60
setup : |
50
61
brew update
51
62
brew install meson llvm
52
63
build : |
53
64
export XWIN_CACHE_DIR="$(pwd)/.xwin"
54
65
export XWIN_ARCH=x86
55
- export CFLAGS="-mavx2 -mpclmul"
66
+ export CFLAGS="-mavx2 -mpclmul /FIintrin.h "
56
67
export CXXFLAGS="-mavx2 -mpclmul"
57
68
export CARGO_PROFILE_RELEASE_LTO="false"
58
69
export PATH="$(brew --prefix llvm)/bin:$PATH"
59
70
clang --version
60
- CARGO="cargo-xwin" yarn workspace @napi-rs/image build --features with_simd --target i686-pc-windows-msvc
71
+ yarn workspace @napi-rs/image build -x --features with_simd --target i686-pc-windows-msvc
61
72
target : i686-pc-windows-msvc
62
73
- host : ubuntu-latest
63
74
target : x86_64-unknown-linux-gnu
@@ -74,17 +85,16 @@ jobs:
74
85
chmod -R 777 target
75
86
- host : ubuntu-latest
76
87
target : x86_64-unknown-linux-musl
77
- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust :lts-alpine
88
+ docker : ghcr.io/brooooooklyn/canvas/musl-builder :lts
78
89
build : >-
79
90
set -e &&
80
- unset RUSTFLAGS &&
81
- unset CC &&
82
- unset CXX &&
83
- apk add --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing --no-cache perl nasm aom-dev meson &&
84
- export LIB_AOM_STATIC_LIB_PATH=/usr/lib &&
85
- export LIB_AOM_INCLUDE_PATH=/usr/include/aom/aom &&
86
- export LIB_AOM_PKG_CONFIG_PATH=/usr/lib/pkgconfig &&
87
- yarn workspace @napi-rs/image build --target x86_64-unknown-linux-musl --features with_simd &&
91
+ apk add libc++-dev libc++-static &&
92
+ cp /usr/lib/gcc/x86_64-alpine-linux-musl/14.2.0/*.o /usr/lib/ &&
93
+ cp /usr/lib/gcc/x86_64-alpine-linux-musl/14.2.0/libgcc.a /usr/lib/ &&
94
+ cp /usr/lib/gcc/x86_64-alpine-linux-musl/14.2.0/libgcc_eh.a /usr/lib/ &&
95
+ wget "https://github.com/Brooooooklyn/canvas/releases/download/libcxxabi-$(cat llvm-version)/libc++abi-x86_64.a" &&
96
+ mv libc++abi-x86_64.a /usr/lib/libc++abi.a &&
97
+ CXXFLAGS="-std=c++20 -stdlib=libc++ -static -fPIC -fno-cxx-exceptions -fno-exceptions -I/usr/include/c++/v1" CC=clang CXX=clang++ yarn workspace @napi-rs/image build --target x86_64-unknown-linux-musl --features with_simd &&
88
98
chmod -R 777 target
89
99
- host : macos-latest
90
100
target : aarch64-apple-darwin
@@ -113,15 +123,6 @@ jobs:
113
123
export CXXFLAGS="-fuse-ld=lld -mcrc -B/usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/4.8.5 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -L/usr/aarch64-unknown-linux-gnu/lib/llvm-18/lib -stdlib=libc++" &&
114
124
yarn workspace @napi-rs/image build --features with_simd --target aarch64-unknown-linux-gnu &&
115
125
chmod -R 777 target
116
- - host : ubuntu-latest
117
- target : armv7-unknown-linux-gnueabihf
118
- setup : |
119
- sudo apt-get update
120
- sudo apt-get install meson gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
121
- build : |
122
- export CC="arm-linux-gnueabihf-gcc"
123
- export CARGO_CFG_TARGET_FEATURE="neon"
124
- yarn workspace @napi-rs/image build --target armv7-unknown-linux-gnueabihf --features oxipng_libdeflater --use-napi-cross
125
126
- host : ubuntu-latest
126
127
target : aarch64-linux-android
127
128
build : |
@@ -153,7 +154,7 @@ jobs:
153
154
export CMAKE_BUILD_PARALLEL_LEVEL=2
154
155
yarn workspace @napi-rs/image build --target wasm32-wasip1-threads
155
156
156
- name : stable - ${{ matrix.settings.target }} - node@20
157
+ name : stable - ${{ matrix.settings.target }} - node@22
157
158
runs-on : ${{ matrix.settings.host }}
158
159
env :
159
160
RUST_TARGET : ${{ matrix.settings.target }}
@@ -162,14 +163,14 @@ jobs:
162
163
- name : Setup node
163
164
uses : actions/setup-node@v4
164
165
with :
165
- node-version : 20
166
+ node-version : 22
166
167
cache : yarn
167
168
- name : Setup nasm
168
169
uses : ilammy/setup-nasm@v1
169
170
if : matrix.settings.target == 'x86_64-pc-windows-msvc' || matrix.settings.target == 'x86_64-apple-darwin' || matrix.settings.target == 'i686-pc-windows-msvc'
170
171
- name : Install cargo-xwin
171
172
uses : taiki-e/install-action@v2
172
- if : matrix.settings.target == 'i686-pc-windows-msvc'
173
+ if : matrix.settings.target == 'i686-pc-windows-msvc' || matrix.settings.target == 'aarch64-pc-windows-msvc'
173
174
env :
174
175
GITHUB_TOKEN : ${{ github.token }}
175
176
with :
@@ -194,11 +195,16 @@ jobs:
194
195
- uses : goto-bus-stop/setup-zig@v2
195
196
if : ${{ contains(matrix.settings.target, 'musl') }}
196
197
with :
197
- version : 0.13.0
198
+ version : 0.14.1
198
199
- name : Setup toolchain
199
200
run : ${{ matrix.settings.setup }}
200
201
if : ${{ matrix.settings.setup }}
201
202
shell : bash
203
+ - name : Install LLVM and Clang
204
+ uses : KyleMayes/install-llvm-action@v2
205
+ if : ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
206
+ with :
207
+ version : ' 20'
202
208
- name : Install dependencies
203
209
run : yarn install --immutable --mode=skip-build
204
210
- name : Build in docker
@@ -220,22 +226,75 @@ jobs:
220
226
packages/*/*.node
221
227
packages/*/*.wasm
222
228
if-no-files-found : error
229
+
230
+
231
+ build-armv7-linux-gnueabihf :
232
+ name : Build armv7-unknown-linux-gnueabihf
233
+ runs-on : ubuntu-latest
234
+ container :
235
+ image : debian:buster
236
+ steps :
237
+ - name : Setup tools
238
+ run : |
239
+ apt-get update
240
+ apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libatomic1-armhf-cross git build-essential cmake ninja-build wget curl gnupg
241
+ echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-18 main" >> /etc/apt/sources.list
242
+ echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-18 main" >> /etc/apt/sources.list
243
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
244
+ apt-get update
245
+ apt-get install -y clang-18
246
+ ln -s /usr/bin/clang-18 /usr/bin/clang
247
+ ln -s /usr/bin/clang++-18 /usr/bin/clang++
248
+ - uses : actions/checkout@v4
249
+ with :
250
+ submodules : true
251
+ - name : Setup cmake
252
+ uses : jwlawson/actions-setup-cmake@v2
253
+ with :
254
+ cmake-version : ' 3.x'
255
+ - name : Setup node
256
+ uses : actions/setup-node@v4
257
+ with :
258
+ node-version : 22
259
+ - name : Install
260
+ uses : dtolnay/rust-toolchain@stable
261
+ with :
262
+ toolchain : stable
263
+ targets : ' armv7-unknown-linux-gnueabihf'
264
+ - name : Install dependencies
265
+ run : |
266
+ corepack enable
267
+ yarn install --immutable --mode=skip-build
268
+ - name : Config git
269
+ run : git config --global --add safe.directory "$(pwd)"
270
+ - name : Build
271
+ run : |
272
+ export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
273
+ yarn workspace @napi-rs/image build --target armv7-unknown-linux-gnueabihf --features oxipng_libdeflater
274
+ - name : Upload artifact
275
+ uses : actions/upload-artifact@v4
276
+ with :
277
+ name : bindings-armv7-unknown-linux-gnueabihf
278
+ path : |
279
+ packages/*/*.node
280
+ if-no-files-found : error
281
+
223
282
build-freebsd :
224
283
runs-on : ubuntu-latest
225
284
name : Build FreeBSD
226
285
steps :
227
286
- uses : actions/checkout@v4
228
287
- name : Build
229
288
id : build
230
- uses : cross-platform-actions/action@v0.26 .0
289
+ uses : cross-platform-actions/action@v0.28 .0
231
290
env :
232
291
DEBUG : ' napi:*'
233
292
RUSTUP_HOME : /home/runner/rustup
234
293
CARGO_HOME : /home/runner/cargo
235
294
RUSTUP_IO_THREADS : 1
236
295
with :
237
296
operating_system : freebsd
238
- version : ' 14.0 '
297
+ version : ' 14.2 '
239
298
memory : 8G
240
299
cpu_count : 3
241
300
environment_variables : ' DEBUG RUSTUP_IO_THREADS'
@@ -284,8 +343,8 @@ jobs:
284
343
- host : macos-latest
285
344
target : aarch64-apple-darwin
286
345
node :
287
- - ' 18'
288
346
- ' 20'
347
+ - ' 22'
289
348
runs-on : ${{ matrix.settings.host }}
290
349
steps :
291
350
- uses : actions/checkout@v4
@@ -310,6 +369,8 @@ jobs:
310
369
with :
311
370
name : bindings-${{ matrix.settings.target }}
312
371
path : artifacts
372
+ - name : Create npm dirs
373
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
313
374
- name : Move artifacts
314
375
run : yarn artifacts
315
376
shell : bash
@@ -332,8 +393,8 @@ jobs:
332
393
fail-fast : false
333
394
matrix :
334
395
node :
335
- - ' 18'
336
396
- ' 20'
397
+ - ' 22'
337
398
runs-on : ubuntu-latest
338
399
steps :
339
400
- uses : actions/checkout@v4
@@ -349,6 +410,8 @@ jobs:
349
410
with :
350
411
name : bindings-x86_64-unknown-linux-gnu
351
412
path : artifacts
413
+ - name : Create npm dirs
414
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
352
415
- name : Move artifacts
353
416
run : yarn artifacts
354
417
shell : bash
@@ -365,8 +428,8 @@ jobs:
365
428
fail-fast : false
366
429
matrix :
367
430
node :
368
- - ' 18'
369
431
- ' 20'
432
+ - ' 22'
370
433
runs-on : ubuntu-latest
371
434
steps :
372
435
- uses : actions/checkout@v4
@@ -382,6 +445,8 @@ jobs:
382
445
with :
383
446
name : bindings-x86_64-unknown-linux-musl
384
447
path : artifacts
448
+ - name : Create npm dirs
449
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
385
450
- name : Move artifacts
386
451
run : yarn artifacts
387
452
shell : bash
@@ -409,6 +474,8 @@ jobs:
409
474
path : artifacts
410
475
- name : Install dependencies
411
476
run : yarn install --immutable --mode=skip-build
477
+ - name : Create npm dirs
478
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
412
479
- name : Move artifacts
413
480
run : yarn artifacts
414
481
shell : bash
@@ -429,13 +496,13 @@ jobs:
429
496
test-linux-arm-gnueabihf-binding :
430
497
name : Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
431
498
needs :
432
- - build
499
+ - build-armv7-linux-gnueabihf
433
500
strategy :
434
501
fail-fast : false
435
502
matrix :
436
503
node :
437
- - ' 18'
438
504
- ' 20'
505
+ - ' 22'
439
506
runs-on : ubuntu-latest
440
507
steps :
441
508
- uses : actions/checkout@v4
@@ -446,6 +513,8 @@ jobs:
446
513
path : artifacts
447
514
- name : Install dependencies
448
515
run : yarn install --immutable --mode=skip-build
516
+ - name : Create npm dirs
517
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
449
518
- name : Move artifacts
450
519
run : yarn artifacts
451
520
shell : bash
@@ -477,6 +546,8 @@ jobs:
477
546
path : artifacts
478
547
- name : Install dependencies
479
548
run : yarn install --immutable --mode=skip-build
549
+ - name : Create npm dirs
550
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
480
551
- name : Move artifacts
481
552
run : yarn artifacts
482
553
shell : bash
@@ -504,10 +575,12 @@ jobs:
504
575
- name : Setup node
505
576
uses : actions/setup-node@v4
506
577
with :
507
- node-version : 20
578
+ node-version : 22
508
579
cache : yarn
509
580
- name : Install dependencies
510
581
run : yarn install --immutable --mode=skip-build
582
+ - name : Create npm dirs
583
+ run : yarn workspace @napi-rs/image napi create-npm-dirs
511
584
- name : Download all artifacts
512
585
uses : actions/download-artifact@v4
513
586
with :
0 commit comments