Skip to content

Commit 2cd050b

Browse files
authored
chore: build targets in binding package.json (#11)
1 parent 2bb347f commit 2cd050b

2 files changed

Lines changed: 41 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,53 @@ jobs:
4747
- name: Run cargo clippy
4848
run: cargo clippy --workspace -- -D warnings
4949

50-
node-build:
51-
runs-on: ubuntu-latest
52-
name: Node.js Build
50+
build:
51+
name: Build
52+
uses: rspack-contrib/rspack-toolchain/.github/workflows/build.yml@main
53+
54+
test:
55+
runs-on: ${{ matrix.os }}
56+
name: Node Test (${{ matrix.os }})
57+
needs: build
58+
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
include:
63+
- os: ubuntu-latest
64+
target: x86_64-unknown-linux-gnu
65+
- os: macos-latest
66+
target: aarch64-apple-darwin
67+
- os: windows-latest
68+
target: x86_64-pc-windows-msvc
5369

5470
steps:
5571
- name: Checkout code
5672
uses: actions/checkout@v4
5773

58-
- name: Install Rust toolchain
59-
uses: dtolnay/rust-toolchain@stable
74+
- name: Get NAPI info
75+
id: napi-info
76+
uses: rspack-contrib/rspack-toolchain/get-napi-info@main
6077

61-
- name: Cache Rust dependencies
62-
uses: Swatinem/rust-cache@v2
78+
- name: Download rspack binding
79+
uses: rspack-contrib/rspack-toolchain/download-rspack-binding@main
80+
with:
81+
target: ${{ matrix.target }}
82+
path: ${{ steps.napi-info.outputs.binding-path }}
83+
84+
- name: Show binding
85+
shell: bash
86+
run: |
87+
echo "Contents of binding directory:"
88+
ls -la ${{ steps.napi-info.outputs.binding-path }}
89+
echo ""
90+
echo "*.node files:"
91+
find ${{ steps.napi-info.outputs.binding-path }} -name "*.node" -type f -exec ls -la {} \; || echo "No .node files found"
6392
6493
- name: Setup Node.js
6594
uses: actions/setup-node@v4
6695
with:
67-
node-version: '18'
96+
node-version: '22'
6897

6998
- name: Enable corepack
7099
run: corepack enable
@@ -83,10 +112,6 @@ jobs:
83112
- name: Install dependencies
84113
run: pnpm install
85114

86-
- name: Build binding
87-
run: pnpm run build
88-
working-directory: crates/binding
89-
90115
- name: Run example - plugin
91116
run: node build.js
92117
working-directory: examples/plugin

crates/binding/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"aarch64-unknown-linux-gnu",
2020
"aarch64-apple-darwin",
2121
"aarch64-unknown-linux-musl",
22-
"aarch64-pc-windows-msvc"
22+
"aarch64-pc-windows-msvc",
23+
"armv7-linux-androideabi",
24+
"armv7-unknown-linux-gnueabihf",
25+
"aarch64-linux-android"
2326
]
2427
}
2528
}

0 commit comments

Comments
 (0)