Skip to content

Commit

Permalink
ci(bindings/nodejs): Support aarch64-apple-darwin
Browse files Browse the repository at this point in the history
Signed-off-by: suyanhanx <suyanhanx@gmail.com>
  • Loading branch information
suyanhanx committed Mar 27, 2023
1 parent 1d563b4 commit a37b568
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 5 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/bindings_nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,30 @@ jobs:
matrix:
node:
- '18'
settings:
- target: x86_64-apple-darwin
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";
yarn build --target aarch64-apple-darwin
strip -x *.node
runs-on: macos-latest
if: "startsWith(github.ref, 'refs/tags/')"
# if: "startsWith(github.ref, 'refs/tags/')"

# Notes: this defaults only apply on run tasks.
defaults:
run:
working-directory: "bindings/nodejs"

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

steps:
- uses: actions/checkout@v3
- name: Setup node
Expand All @@ -165,10 +181,11 @@ 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
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"
}
}
14 changes: 13 additions & 1 deletion 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 Expand Up @@ -76,5 +82,11 @@
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"packageManager": "yarn@3.4.1+sha224.cca891d4a8671d4898aba3426674bb734dbbf88cef82dd4dacd71c9f"
"packageManager": "yarn@3.4.1+sha224.cca891d4a8671d4898aba3426674bb734dbbf88cef82dd4dacd71c9f",
"optionalDependencies": {
"@opendal/lib-win32-x64-msvc": "0.30.4",
"@opendal/lib-darwin-x64": "0.30.4",
"@opendal/lib-linux-x64-gnu": "0.30.4",
"@opendal/lib-darwin-arm64": "0.30.4"
}
}

0 comments on commit a37b568

Please sign in to comment.