diff --git a/.github/workflows/bindings_nodejs.yml b/.github/workflows/bindings_nodejs.yml index a5d7ac438ec..4e457f794e5 100644 --- a/.github/workflows/bindings_nodejs.yml +++ b/.github/workflows/bindings_nodejs.yml @@ -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/')" @@ -152,6 +168,8 @@ jobs: run: working-directory: "bindings/nodejs" + name: macos - ${{ matrix.settings.target }} + steps: - uses: actions/checkout@v3 - name: Setup node @@ -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 diff --git a/bindings/nodejs/index.d.ts b/bindings/nodejs/index.d.ts index 34cdbae3f8e..713f5ddbc09 100644 --- a/bindings/nodejs/index.d.ts +++ b/bindings/nodejs/index.d.ts @@ -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 } diff --git a/bindings/nodejs/npm/darwin-arm64/README.md b/bindings/nodejs/npm/darwin-arm64/README.md new file mode 100644 index 00000000000..7d907fdedb8 --- /dev/null +++ b/bindings/nodejs/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `@opendal/lib-darwin-arm64` + +This is the **aarch86_64-apple-darwin** binary for `opendal` diff --git a/bindings/nodejs/npm/darwin-arm64/package.json b/bindings/nodejs/npm/darwin-arm64/package.json new file mode 100644 index 00000000000..553cb293e77 --- /dev/null +++ b/bindings/nodejs/npm/darwin-arm64/package.json @@ -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" + } +} diff --git a/bindings/nodejs/package.json b/bindings/nodejs/package.json index b416c3d2152..6c1f13318de 100644 --- a/bindings/nodejs/package.json +++ b/bindings/nodejs/package.json @@ -11,6 +11,12 @@ "name": "opendal", "package": { "name": "@opendal/lib" + }, + "triples": { + "defaults": true, + "additional": [ + "aarch64-apple-darwin" + ] } }, "keywords": [