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

ci(bindings/nodejs): Support aarch64-apple-darwin #1780

Merged
merged 3 commits into from
Mar 28, 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
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