21
21
settings :
22
22
- host : macos-latest
23
23
target : ' x86_64-apple-darwin'
24
- build : yarn build
24
+ build : |
25
+ yarn build
26
+ strip -x packages/*/*.node
25
27
- host : windows-latest
26
28
build : yarn build
27
29
target : ' x86_64-pc-windows-msvc'
@@ -35,44 +37,49 @@ jobs:
35
37
setup : |
36
38
choco install nodejs-lts --x86 -y --force
37
39
echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
38
- - host : ubuntu-20.04
40
+ - host : ubuntu-latest
39
41
target : ' x86_64-unknown-linux-gnu'
40
42
docker : |
41
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
42
43
docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian
43
44
docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian builder
44
45
build : |
45
46
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build
46
- - host : ubuntu-20.04
47
+ - host : ubuntu-latest
47
48
target : ' x86_64-unknown-linux-musl'
48
49
docker : |
49
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
50
50
docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine
51
51
docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
52
52
build : docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build
53
53
- host : macos-latest
54
54
target : ' aarch64-apple-darwin'
55
- build : npx lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
56
- - host : ubuntu-20.04
55
+ build : |
56
+ sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
57
+ export CC=$(xcrun -f clang);
58
+ export CXX=$(xcrun -f clang++);
59
+ SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
60
+ export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
61
+ npx lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
62
+ strip -x packages/*/*.node
63
+ - host : ubuntu-latest
57
64
target : ' aarch64-unknown-linux-gnu'
58
65
setup : |
59
66
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y
60
67
build : npx lerna exec "yarn build --target aarch64-unknown-linux-gnu" --concurrency 1 --stream --no-prefix
61
- - host : ubuntu-20.04
68
+ - host : ubuntu-latest
62
69
target : ' armv7-unknown-linux-gnueabihf'
63
70
setup : |
64
71
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
65
72
build : npx lerna exec "yarn build --target armv7-unknown-linux-gnueabihf" --concurrency 1 --stream --no-prefix
66
- - host : ubuntu-20.04
73
+ - host : ubuntu-latest
67
74
target : ' aarch64-linux-android'
68
75
build : |
69
76
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
77
+ export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
70
78
npx lerna exec "yarn build --target aarch64-linux-android" --concurrency 1 --stream --no-prefix
71
79
- host : ubuntu-latest
72
80
target : ' aarch64-unknown-linux-musl'
73
81
downloadTarget : ' aarch64-unknown-linux-musl'
74
82
docker : |
75
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
76
83
docker pull ghcr.io/brooooooklyn/canvas/musl-builder:lts
77
84
docker tag ghcr.io/brooooooklyn/canvas/musl-builder:lts builder
78
85
build : docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/node-rs -w /node-rs builder sh -c "rustup toolchain install $(cat ./rust-toolchain) && rustup target add aarch64-unknown-linux-musl && npx lerna exec \"yarn build --target aarch64-unknown-linux-musl\" --concurrency 1 --stream --no-prefix"
@@ -105,19 +112,19 @@ jobs:
105
112
command : generate-lockfile
106
113
107
114
- name : Cache cargo registry
108
- uses : actions/cache@v1
115
+ uses : actions/cache@v2
109
116
with :
110
117
path : ~/.cargo/registry
111
118
key : ${{ matrix.settings.target }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
112
119
113
120
- name : Cache cargo index
114
- uses : actions/cache@v1
121
+ uses : actions/cache@v2
115
122
with :
116
123
path : ~/.cargo/git
117
124
key : ${{ matrix.settings.target }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
118
125
119
126
- name : Cache NPM dependencies
120
- uses : actions/cache@v1
127
+ uses : actions/cache@v2
121
128
with :
122
129
path : node_modules
123
130
key : npm-cache-${{ matrix.settings.target }}-node@14-${{ hashFiles('yarn.lock') }}
@@ -296,7 +303,7 @@ jobs:
296
303
fail-fast : false
297
304
matrix :
298
305
node : ['12', '14', '16']
299
- runs-on : ubuntu-20.04
306
+ runs-on : ubuntu-latest
300
307
301
308
steps :
302
309
- uses : actions/checkout@v2
@@ -338,7 +345,7 @@ jobs:
338
345
fail-fast : false
339
346
matrix :
340
347
node : ['12', '14', '16']
341
- runs-on : ubuntu-20.04
348
+ runs-on : ubuntu-latest
342
349
343
350
steps :
344
351
- run : docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -363,27 +370,21 @@ jobs:
363
370
shell : bash
364
371
365
372
- name : Setup and run tests
366
- uses : docker://multiarch/ubuntu-core:arm64-focal
373
+ uses : addnab/docker-run-action@v3
367
374
with :
368
- args : >
369
- sh -c "
370
- apt-get update && \
371
- apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \
372
- curl -sL https://deb.nodesource.com/setup_${{ matrix.node }}.x | bash - && \
373
- apt-get install -y nodejs && \
374
- npm install -g yarn && \
375
- yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 && \
376
- yarn build:ts && \
377
- yarn test && \
378
- ls -la
379
- "
375
+ image : ghcr.io/napi-rs/napi-rs/nodejs:aarch64-${{ matrix.node }}
376
+ options : -v ${{ github.workspace }}:/skia -w /skia
377
+ run : |
378
+ pnpm install --ignore-scripts && \
379
+ npm test && \
380
+ ls -la
380
381
381
382
test-linux-aarch64-musl-binding :
382
383
name : Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }}
383
384
needs :
384
385
- build
385
386
386
- runs-on : ubuntu-20.04
387
+ runs-on : ubuntu-latest
387
388
388
389
steps :
389
390
- run : docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -426,7 +427,7 @@ jobs:
426
427
fail-fast : false
427
428
matrix :
428
429
node : ['12', '14', '16']
429
- runs-on : ubuntu-20.04
430
+ runs-on : ubuntu-latest
430
431
431
432
steps :
432
433
- run : docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -451,20 +452,14 @@ jobs:
451
452
shell : bash
452
453
453
454
- name : Setup and run tests
454
- uses : docker://multiarch/ubuntu-core:armhf-focal
455
+ uses : addnab/docker-run-action@v3
455
456
with :
456
- args : >
457
- sh -c "
458
- apt-get update && \
459
- apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \
460
- curl -sL https://deb.nodesource.com/setup_${{ matrix.node }}.x | bash - && \
461
- apt-get install -y nodejs && \
462
- npm install -g yarn && \
463
- yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 && \
464
- yarn build:ts && \
465
- yarn test && \
466
- ls -la
467
- "
457
+ image : ghcr.io/napi-rs/napi-rs/nodejs:armhf-${{ matrix.node }}
458
+ options : -v ${{ github.workspace }}:/skia -w /skia
459
+ run : |
460
+ pnpm install --ignore-scripts && \
461
+ npm test && \
462
+ ls -la
468
463
469
464
publish :
470
465
name : Publish
@@ -486,7 +481,7 @@ jobs:
486
481
check-latest : true
487
482
488
483
- name : Cache NPM dependencies
489
- uses : actions/cache@v1
484
+ uses : actions/cache@v2
490
485
with :
491
486
path : node_modules
492
487
key : npm-cache-ubuntu-latest-publish-${{ hashFiles('yarn.lock') }}
0 commit comments