Skip to content

Commit

Permalink
Fix: build more target for different platform (#41)
Browse files Browse the repository at this point in the history
* fix: build more target

* chore: test

* fix: add target

* fix: test ci

* fix: test case

* fix: ci

* fix: add npm target

* fix: ci

* fix: test simple ci

* fix: test ci

* fix: test ci
  • Loading branch information
ClarkXia authored May 13, 2024
1 parent 6e71e22 commit bbe3f2c
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 15 deletions.
60 changes: 46 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,33 @@ jobs:
target: x86_64-apple-darwin
build: |
cd crates/node_binding
pnpm build
pnpm build --target x86_64-apple-darwin
strip -x *.node
- host: macos-latest
name: darwin-arm64
target: aarch64-apple-darwin
build: |
cd crates/node_binding
pnpm build --target aarch64-apple-darwin
strip -x *.node
- host: windows-latest
build: cd crates/node_binding && pnpm build
name: win32-x64-msvc
target: x86_64-pc-windows-msvc
build: |
cd crates/node_binding
pnpm build --target x86_64-pc-windows-msvc
- host: windows-latest
target: aarch64-pc-windows-msvc
name: win32-arm64-msvc
build: |
cd crates/node_binding
pnpm build --target aarch64-pc-windows-msvc
- host: windows-latest
target: i686-pc-windows-msvc
name: win32-ia32-msvc
build: |
cd crates/node_binding
pnpm build --target i686-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: linux-x64-gnu
Expand All @@ -43,24 +64,35 @@ jobs:
set -e &&
cd crates/node_binding &&
unset CC_x86_64_unknown_linux_gnu && unset CC &&
npm run build -- --target x86_64-unknown-linux-gnu &&
pnpm build --target x86_64-unknown-linux-gnu &&
strip *.node
- host: ubuntu-latest
name: linux-x64-musl
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: cd crates/node_binding && set -e && pnpm build && strip *.node
- host: macos-latest
name: darwin-arm64
target: aarch64-apple-darwin
build: |
cd crates/node_binding
pnpm build --target aarch64-apple-darwin
strip -x *.node
- host: windows-latest
target: aarch64-pc-windows-msvc
name: win32-arm64-msvc
build: cd crates/node_binding && pnpm build --target aarch64-pc-windows-msvc
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
name: linux-arm64-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
cd crates/node_binding &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 && export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc &&
rustup target add aarch64-unknown-linux-gnu &&
pnpm build --target aarch64-unknown-linux-gnu &&
aarch64-unknown-linux-gnu-strip *.node
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
name: linux-arm64-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
cd crates/node_binding &&
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc &&
rustup target add aarch64-unknown-linux-musl &&
pnpm build --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions crates/node_binding/npm/linux-arm64-gnu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@ice/pack-binding-linux-arm64-gnu`

This is the **aarch64-unknown-linux-gnu** binary for `@ice/pack-binding`
24 changes: 24 additions & 0 deletions crates/node_binding/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@ice/pack-binding-linux-arm64-gnu",
"version": "0.0.1",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "pack-binding.linux-arm64-gnu.node",
"files": [
"pack-binding.linux-arm64-gnu.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": [
"glibc"
],
"repository": {
"url": "https://github.com/ice-lab/icepack"
}
}
3 changes: 3 additions & 0 deletions crates/node_binding/npm/linux-arm64-musl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@ice/pack-binding-linux-arm64-musl`

This is the **arm64-unknown-linux-musl** binary for `@ice/pack-binding`
24 changes: 24 additions & 0 deletions crates/node_binding/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@ice/pack-binding-linux-arm64-musl",
"version": "0.0.1",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "pack-binding.linux-arm64-musl.node",
"files": [
"pack-binding.linux-arm64-musl.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"libc": [
"musl"
],
"repository": {
"url": "https://github.com/ice-lab/icepack"
}
}
3 changes: 3 additions & 0 deletions crates/node_binding/npm/win32-ia32-msvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@ice/pack-binding-win32-ia32-msvc`

This is the **i686-pc-windows-msvc** binary for `@ice/pack-binding`
21 changes: 21 additions & 0 deletions crates/node_binding/npm/win32-ia32-msvc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@ice/pack-binding-win32-ia32-msvc",
"version": "0.0.1",
"os": [
"win32"
],
"cpu": [
"i686"
],
"main": "pack-binding.win32-ia32-msvc.node",
"files": [
"pack-binding.win32-ia32-msvc.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"repository": {
"url": "https://github.com/ice-lab/icepack"
}
}
5 changes: 4 additions & 1 deletion crates/node_binding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"aarch64-apple-darwin",
"aarch64-pc-windows-msvc",
"x86_64-unknown-linux-musl",
"universal-apple-darwin"
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"universal-apple-darwin",
"i686-pc-windows-msvc"
]
}
},
Expand Down

0 comments on commit bbe3f2c

Please sign in to comment.