diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a21c1b0..b38677f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: matrix: settings: - host: macos-latest + name: darwin-x64 target: x86_64-apple-darwin build: | cd crates/node_binding @@ -32,9 +33,11 @@ jobs: 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 && @@ -43,10 +46,12 @@ 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 @@ -54,6 +59,7 @@ jobs: 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 }} @@ -102,14 +108,41 @@ 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 @@ -117,7 +150,7 @@ jobs: - 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 diff --git a/crates/node_binding/npm/darwin-arm64/package.json b/crates/node_binding/npm/darwin-arm64/package.json index 272a590..e53a1a4 100644 --- a/crates/node_binding/npm/darwin-arm64/package.json +++ b/crates/node_binding/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@ice/pack-binding-darwin-arm64", - "version": "0.0.0", + "version": "0.0.1", "os": [ "darwin" ], diff --git a/crates/node_binding/npm/darwin-universal/README.md b/crates/node_binding/npm/darwin-universal/README.md new file mode 100644 index 0000000..6935816 --- /dev/null +++ b/crates/node_binding/npm/darwin-universal/README.md @@ -0,0 +1,3 @@ +# `@ice/pack-binding-darwin-universal` + +This is the **universal-apple-darwin** binary for `@ice/pack-binding` \ No newline at end of file diff --git a/crates/node_binding/npm/darwin-universal/package.json b/crates/node_binding/npm/darwin-universal/package.json new file mode 100644 index 0000000..45d2b15 --- /dev/null +++ b/crates/node_binding/npm/darwin-universal/package.json @@ -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" + } +} \ No newline at end of file diff --git a/crates/node_binding/npm/darwin-x64/package.json b/crates/node_binding/npm/darwin-x64/package.json index 866c8a6..e0bc47c 100644 --- a/crates/node_binding/npm/darwin-x64/package.json +++ b/crates/node_binding/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@ice/pack-binding-darwin-x64", - "version": "0.0.0", + "version": "0.0.1", "os": [ "darwin" ], diff --git a/crates/node_binding/npm/linux-x64-gnu/package.json b/crates/node_binding/npm/linux-x64-gnu/package.json index 23d2266..c649831 100644 --- a/crates/node_binding/npm/linux-x64-gnu/package.json +++ b/crates/node_binding/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@ice/pack-binding-linux-x64-gnu", - "version": "0.0.0", + "version": "0.0.1", "os": [ "linux" ], diff --git a/crates/node_binding/npm/linux-x64-musl/README.md b/crates/node_binding/npm/linux-x64-musl/README.md new file mode 100644 index 0000000..6cee88e --- /dev/null +++ b/crates/node_binding/npm/linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `@ice/pack-binding-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `@ice/pack-binding` diff --git a/crates/node_binding/npm/linux-x64-musl/package.json b/crates/node_binding/npm/linux-x64-musl/package.json new file mode 100644 index 0000000..78b14b7 --- /dev/null +++ b/crates/node_binding/npm/linux-x64-musl/package.json @@ -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" + } +} \ No newline at end of file diff --git a/crates/node_binding/npm/win32-arm64-msvc/README.md b/crates/node_binding/npm/win32-arm64-msvc/README.md new file mode 100644 index 0000000..74961fc --- /dev/null +++ b/crates/node_binding/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@ice/pack-binding-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@ice/pack-binding` diff --git a/crates/node_binding/npm/win32-arm64-msvc/package.json b/crates/node_binding/npm/win32-arm64-msvc/package.json new file mode 100644 index 0000000..1eb8b21 --- /dev/null +++ b/crates/node_binding/npm/win32-arm64-msvc/package.json @@ -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" + } +} \ No newline at end of file diff --git a/crates/node_binding/package.json b/crates/node_binding/package.json index 0f12da4..305ceab 100644 --- a/crates/node_binding/package.json +++ b/crates/node_binding/package.json @@ -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" @@ -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" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2899f6d..01139e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: crates/node_binding: devDependencies: '@napi-rs/cli': - specifier: ^2.16.3 - version: 2.16.3 + specifier: ^2.16.4 + version: 2.16.5 packages: @@ -44,8 +44,8 @@ packages: wrap-ansi-cjs: /wrap-ansi@7.0.0 dev: true - /@napi-rs/cli@2.16.3: - resolution: {integrity: sha512-3mLNPlbbOhpbIUKicLrJtIearlHXUuXL3UeueYyRRplpVMNkdn8xCyzY6PcYZi3JXR8bmCOiWgkVmLnrSL7DKw==} + /@napi-rs/cli@2.16.5: + resolution: {integrity: sha512-mFEzwrg4IOLngGd2/P6yeqIWgwQNn59Z08n1rndu6kLDq1gg954NH9cM1O9Da0RJuybt46p43lqgSsnAY2mxqA==} engines: {node: '>= 10'} hasBin: true dev: true