Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: universal ci #18

Merged
merged 11 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ jobs:
matrix:
settings:
- host: macos-latest
name: darwin-x64
target: x86_64-apple-darwin
build: |
cd crates/node_binding
pnpm build
strip -x *.node
- host: windows-latest
build: cd crates/node_binding && pnpm build
name: win32-x64-msvc
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: linux-x64-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
Expand All @@ -43,17 +46,20 @@ jobs:
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
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
Expand Down Expand Up @@ -102,22 +108,49 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
name: ${{ env.APP_NAME }}.${{ matrix.settings.name }}.node
path: crates/node_binding/${{ env.APP_NAME }}.*.node
if-no-files-found: error
universal-macOS:
name: Build universal macOS binary
needs:
- build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Pnpm Cache # Required by some tests
uses: ./.github/actions/pnpm-cache
- name: Download macOS x64 artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.APP_NAME }}.darwin-x64.node
path: crates/node_binding/artifacts
- name: Download macOS arm64 artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.APP_NAME }}.darwin-arm64.node
path: crates/node_binding/artifacts
- name: Combine binaries
run: cd crates/node_binding && pnpm universal
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}.darwin-universal.node
path: crates/node_binding/${{ env.APP_NAME }}.*.node
if-no-files-found: error
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- build
- universal-macOS
steps:
- uses: actions/checkout@v4
- name: Pnpm Cache # Required by some tests
uses: ./.github/actions/pnpm-cache
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: crates/node_binding
path: crates/node_binding/artifacts
- name: Move artifacts
run: cd crates/node_binding && pnpm artifacts
- name: List packages
Expand Down
2 changes: 1 addition & 1 deletion crates/node_binding/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/pack-binding-darwin-arm64",
"version": "0.0.0",
"version": "0.0.1",
"os": [
"darwin"
],
Expand Down
3 changes: 3 additions & 0 deletions crates/node_binding/npm/darwin-universal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@ice/pack-binding-darwin-universal`

This is the **universal-apple-darwin** binary for `@ice/pack-binding`
18 changes: 18 additions & 0 deletions crates/node_binding/npm/darwin-universal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@ice/pack-binding-darwin-universal",
"version": "0.0.1",
"os": [
"darwin"
],
"main": "pack-binding.darwin-universal.node",
"files": [
"pack-binding.darwin-universal.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"repository": {
"url": "https://github.com/ice-lab/awesome-ice"
}
}
2 changes: 1 addition & 1 deletion crates/node_binding/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/pack-binding-darwin-x64",
"version": "0.0.0",
"version": "0.0.1",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion crates/node_binding/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/pack-binding-linux-x64-gnu",
"version": "0.0.0",
"version": "0.0.1",
"os": [
"linux"
],
Expand Down
3 changes: 3 additions & 0 deletions crates/node_binding/npm/linux-x64-musl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@ice/pack-binding-linux-x64-musl`

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

This is the **aarch64-pc-windows-msvc** binary for `@ice/pack-binding`
21 changes: 21 additions & 0 deletions crates/node_binding/npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@ice/pack-binding-win32-arm64-msvc",
"version": "0.0.1",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"main": "pack-binding.win32-arm64-msvc.node",
"files": [
"pack-binding.win32-arm64-msvc.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
},
"repository": {
"url": "https://github.com/ice-lab/awesome-ice"
}
}
8 changes: 6 additions & 2 deletions crates/node_binding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
"name": "pack-binding",
"triples": {
"additional": [
"aarch64-apple-darwin"
"aarch64-apple-darwin",
"aarch64-pc-windows-msvc",
"x86_64-unknown-linux-musl",
"universal-apple-darwin"
]
}
},
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "^2.16.3"
"@napi-rs/cli": "^2.16.4"
},
"ava": {
"timeout": "3m"
Expand All @@ -27,6 +30,7 @@
"build:debug": "napi build --platform",
"build:debug:aarch64": "napi build --platform --target aarch64-apple-darwin",
"prepublishOnly": "napi prepublish -t npm",
"universal": "napi universal",
"version": "napi version"
}
}
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.