Skip to content

Commit 528cdae

Browse files
committed
add arm64 ci [skip skia]
1 parent c06d246 commit 528cdae

File tree

5 files changed

+63
-16
lines changed

5 files changed

+63
-16
lines changed

.github/workflows/CI.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ env:
55
APP_NAME: 'skia'
66
MACOSX_DEPLOYMENT_TARGET: '10.13'
77

8-
permissions:
9-
contents: write
10-
id-token: write
11-
128
on:
139
push:
1410
branches:
@@ -87,6 +83,12 @@ jobs:
8783
clang --version
8884
yarn build --target x86_64-apple-darwin
8985
downloadTarget: ''
86+
- host: windows-latest
87+
setup: |
88+
choco upgrade llvm
89+
build: yarn build --target aarch64-pc-windows-msvc
90+
target: 'aarch64-pc-windows-msvc'
91+
downloadTarget: 'aarch64-pc-windows-msvc'
9092
- host: windows-latest
9193
setup: |
9294
choco upgrade llvm
@@ -299,10 +301,16 @@ jobs:
299301
settings:
300302
- host: macos-latest
301303
target: 'x86_64-apple-darwin'
304+
architecture: 'x64'
302305
- host: macos-latest
303306
target: 'aarch64-apple-darwin'
307+
architecture: 'arm64'
304308
- host: windows-latest
305309
target: 'x86_64-pc-windows-msvc'
310+
architecture: 'x64'
311+
- host: windows-11-arm
312+
target: 'aarch64-pc-windows-msvc'
313+
architecture: 'arm64'
306314
node: ['20', '22']
307315
runs-on: ${{ matrix.settings.host }}
308316

@@ -322,19 +330,10 @@ jobs:
322330

323331
- name: Setup node
324332
uses: actions/setup-node@v4
325-
if: startsWith(matrix.settings.target, 'x86_64')
326333
with:
327334
node-version: ${{ matrix.node }}
328335
cache: 'yarn'
329-
architecture: 'x64'
330-
331-
- name: Setup node
332-
uses: actions/setup-node@v4
333-
if: startsWith(matrix.settings.target, 'aarch64')
334-
with:
335-
node-version: ${{ matrix.node }}
336-
cache: 'yarn'
337-
architecture: 'arm64'
336+
architecture: ${{ matrix.settings.architecture }}
338337

339338
- name: Install dependencies
340339
run: yarn install --immutable --mode=skip-build
@@ -346,7 +345,7 @@ jobs:
346345
path: .
347346

348347
- name: Download icudtl.dat
349-
if: matrix.settings.host == 'windows-latest'
348+
if: ${{ contains(matrix.settings.host, 'windows') }}
350349
run: node ./scripts/release-skia-binary.mjs --download-icu
351350

352351
- name: Test bindings
@@ -685,6 +684,9 @@ jobs:
685684
publish:
686685
name: Publish
687686
runs-on: ubuntu-latest
687+
permissions:
688+
contents: write
689+
id-token: write
688690
needs:
689691
- test-linux-x64-gnu-binding
690692
- test-linux-x64-musl-binding

npm/win32-arm64-msvc/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@napi-rs/canvas-win32-x64-msvc`
2+
3+
This is the **x86_64-pc-windows-msvc** binary for `@napi-rs/canvas`

npm/win32-arm64-msvc/package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "@napi-rs/canvas-win32-x64-msvc",
3+
"version": "0.1.76",
4+
"os": [
5+
"win32"
6+
],
7+
"cpu": [
8+
"arm64"
9+
],
10+
"main": "skia.win32-arm64-msvc.node",
11+
"files": [
12+
"skia.win32-arm64-msvc.node",
13+
"icudtl.dat"
14+
],
15+
"description": "Canvas for Node.js with skia backend",
16+
"keywords": [
17+
"napi-rs",
18+
"NAPI",
19+
"N-API",
20+
"Rust",
21+
"node-addon",
22+
"node-addon-api",
23+
"canvas",
24+
"image",
25+
"pdf",
26+
"svg",
27+
"skia"
28+
],
29+
"license": "MIT",
30+
"engines": {
31+
"node": ">= 10"
32+
},
33+
"publishConfig": {
34+
"registry": "https://registry.npmjs.org/",
35+
"access": "public"
36+
},
37+
"repository": {
38+
"type": "git",
39+
"url": "git+https://github.com/Brooooooklyn/canvas.git"
40+
}
41+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"x86_64-unknown-linux-gnu",
3838
"x86_64-apple-darwin",
3939
"x86_64-pc-windows-msvc",
40+
"aarch64-pc-windows-msvc",
4041
"armv7-unknown-linux-gnueabihf",
4142
"x86_64-unknown-linux-musl",
4243
"aarch64-unknown-linux-gnu",

scripts/release-skia-binary.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ async function download() {
126126
}
127127
if (PLATFORM_NAME === 'win32') {
128128
await downloadIcu()
129-
await fs.copyFile(join(dirname, '..', ICU_DAT), join(dirname, '..', 'npm', 'win32-x64-msvc', ICU_DAT))
130129
}
131130
}
132131

@@ -136,6 +135,7 @@ function downloadIcu() {
136135
stdio: 'inherit',
137136
})
138137
copyFileSync(join(dirname, '..', ICU_DAT), join(dirname, '..', 'npm', 'win32-x64-msvc', ICU_DAT))
138+
copyFileSync(join(dirname, '..', ICU_DAT), join(dirname, '..', 'npm', 'win32-arm64-msvc', ICU_DAT))
139139
return Promise.resolve(null)
140140
}
141141

0 commit comments

Comments
 (0)