Skip to content

Commit

Permalink
ci(bindings/nodejs): Support aarch64-apple-darwin (#1780)
Browse files Browse the repository at this point in the history
* ci(bindings/nodejs): Support aarch64-apple-darwin

Signed-off-by: suyanhanx <suyanhanx@gmail.com>

* macos test only on default arch

Signed-off-by: suyanhanx <suyanhanx@gmail.com>

* reset to build on tag only

Signed-off-by: suyanhanx <suyanhanx@gmail.com>

---------

Signed-off-by: suyanhanx <suyanhanx@gmail.com>
  • Loading branch information
suyanhanx committed Mar 28, 2023
1 parent 63918c2 commit 24783d2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/bindings_nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@ jobs:
matrix:
node:
- '18'
settings:
- target: x86_64-apple-darwin
test: yarn test
build: |
yarn build
strip -x *.node
- target: aarch64-apple-darwin
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
rustup target add aarch64-apple-darwin;
yarn build --target aarch64-apple-darwin
strip -x *.node
runs-on: macos-latest
if: "startsWith(github.ref, 'refs/tags/')"

Expand All @@ -152,6 +168,8 @@ jobs:
run:
working-directory: "bindings/nodejs"

name: macos - ${{ matrix.settings.target }}

steps:
- uses: actions/checkout@v3
- name: Setup node
Expand All @@ -165,13 +183,16 @@ jobs:
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
run: ${{ matrix.settings.build }}
shell: bash
- uses: actions/upload-artifact@v3
with:
name: bindings-macos
name: bindings-macos-${{ matrix.settings.target }}
path: bindings/nodejs/*.node
- name: Test bindings
run: yarn test
if: ${{ matrix.settings.test }}
run: ${{ matrix.settings.test }}
shell: bash

release:
name: Release
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class PresignedRequest {
/**
* Returns the headers of this request.
*
* The key of the map is the header name, and the value is the header value AS bytes.
* The key of the map is the header name, and the value is the header value.
*/
headers(): Record<string, string>
}
3 changes: 3 additions & 0 deletions bindings/nodejs/npm/darwin-arm64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@opendal/lib-darwin-arm64`

This is the **aarch86_64-apple-darwin** binary for `opendal`
18 changes: 18 additions & 0 deletions bindings/nodejs/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@opendal/lib-darwin-arm64",
"version": "0.30.4",
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"main": "opendal.darwin-arm64.node",
"files": [
"opendal.darwin-arm64.node"
],
"license": "Apache-2.0",
"engines": {
"node": ">= 10"
}
}
6 changes: 6 additions & 0 deletions bindings/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"name": "opendal",
"package": {
"name": "@opendal/lib"
},
"triples": {
"defaults": true,
"additional": [
"aarch64-apple-darwin"
]
}
},
"keywords": [
Expand Down

0 comments on commit 24783d2

Please sign in to comment.