You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/03/31 04:11:55 UTC

[incubator-opendal] branch main updated: ci: Fix build for nodejs binding on macos (#1813)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 8fe859a6 ci: Fix build for nodejs binding on macos (#1813)
8fe859a6 is described below

commit 8fe859a640a216305835ad5d366d3927a7b8d3d1
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Fri Mar 31 12:11:50 2023 +0800

    ci: Fix build for nodejs binding on macos (#1813)
    
    * ci: Fix build for nodejs binding on macos
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Fix typo
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Fix build
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Fix publish
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * rollback changes
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    * Remove comments
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
    
    ---------
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 .github/workflows/bindings_nodejs.yml | 6 ++++--
 bindings/nodejs/package.json          | 8 +++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/bindings_nodejs.yml b/.github/workflows/bindings_nodejs.yml
index b1d93962..2ba617d5 100644
--- a/.github/workflows/bindings_nodejs.yml
+++ b/.github/workflows/bindings_nodejs.yml
@@ -163,7 +163,9 @@ jobs:
               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
+
+              export NAPI_TARGET=aarch64-apple-darwin;
+              yarn build
               strip -x *.node
     runs-on: macos-latest
     if: "startsWith(github.ref, 'refs/tags/')"
@@ -228,7 +230,7 @@ jobs:
         with:
           path: bindings/nodejs/artifacts
       - name: Move artifacts
-        run: yarn artifacts
+        run: yarn run napi artifacts
 
       - name: List packages
         run: ls -R ./npm
diff --git a/bindings/nodejs/package.json b/bindings/nodejs/package.json
index 8afe648f..7f8944a0 100644
--- a/bindings/nodejs/package.json
+++ b/bindings/nodejs/package.json
@@ -60,16 +60,14 @@
     "node": ">= 10"
   },
   "scripts": {
-    "artifacts": "napi artifacts",
-    "build": "napi build --platform --release --js generated.js && node ./scripts/header.js",
-    "build:debug": "napi build --platform --js generated.js && node ./scripts/header.js",
+    "build": "napi build --platform --target \"${NAPI_TARGET:-}\" --release --js generated.js && node ./scripts/header.js",
+    "build:debug": "napi build --platform --target \"${NAPI_TARGET:-}\" --js generated.js && node ./scripts/header.js",
     "docs": "typedoc",
     "format": "prettier --write .",
-    "prepublishOnly": "napi prepublish -t npm",
     "test": "cucumber-js",
     "bench": "node -r dotenv/config ./benchmark/node.js dotenv_config_path=./.env",
     "bench:deno": "deno bench ./benchmark/deno.ts --reload=npm:opendal --allow-read --allow-ffi --allow-net --allow-env",
-    "version": "napi version"
+    "prepublishOnly": "napi prepublish -t npm"
   },
   "prettier": {
     "overrides": [