diff --git a/.github/workflows/napi2.yml b/.github/workflows/napi2.yml index f8da0e0..fd401bb 100644 --- a/.github/workflows/napi2.yml +++ b/.github/workflows/napi2.yml @@ -25,16 +25,16 @@ jobs: - os: macos-latest target: x86_64-apple-darwin build: | - yarn build + yarn build && yarn post-build strip -x *.node #- os: windows-latest - # build: yarn build + # build: yarn build && yarn post-build # target: x86_64-pc-windows-msvc #- os: windows-latest # build: | - # yarn build --target i686-pc-windows-msvc + # yarn build --target i686-pc-windows-msvc && yarn post-build # target: i686-pc-windows-msvc - os: ubuntu-latest @@ -43,13 +43,14 @@ jobs: build: |- set -e && cd ./languages/node && - yarn build --target x86_64-unknown-linux-gnu && + export npm_config_target=x86_64-unknown-linux-gnu + yarn build && yarn post-build strip *.node - os: ubuntu-latest target: x86_64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - build: set -e && cd ./languages/node && yarn build && strip *.node + build: set -e && cd ./languages/node && yarn build && yarn post-build && strip *.node - os: macos-latest target: aarch64-apple-darwin @@ -59,7 +60,7 @@ jobs: export CXX=$(xcrun -f clang++); SYSROOT=$(xcrun --sdk macosx --show-sdk-path); export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; - yarn build --target aarch64-apple-darwin + yarn build --target aarch64-apple-darwin && yarn post-build strip -x *.node - os: ubuntu-latest target: aarch64-unknown-linux-gnu @@ -67,22 +68,22 @@ jobs: build: |- set -e && cd ./languages/node - yarn build --target aarch64-unknown-linux-gnu + yarn build --target aarch64-unknown-linux-gnu && yarn post-build - os: ubuntu-latest target: armv7-unknown-linux-gnueabihf setup: | sudo apt-get update sudo apt-get install gcc-arm-linux-gnueabihf -y build: | - yarn build --target armv7-unknown-linux-gnueabihf + yarn build --target armv7-unknown-linux-gnueabihf && yarn post-build - os: ubuntu-latest target: aarch64-linux-android build: | - yarn build --target aarch64-linux-android + yarn build --target aarch64-linux-android && yarn post-build - os: ubuntu-latest target: armv7-linux-androideabi build: | - yarn build --target armv7-linux-androideabi + yarn build --target armv7-linux-androideabi && yarn post-build - os: ubuntu-latest target: aarch64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine @@ -90,11 +91,11 @@ jobs: set -e && rustup target add aarch64-unknown-linux-musl && cd ./languages/node && - yarn build --target aarch64-unknown-linux-musl + yarn build --target aarch64-unknown-linux-musl && yarn post-build #- os: windows-latest # target: aarch64-pc-windows-msvc - # build: yarn build --target aarch64-pc-windows-msvc + # build: yarn build --target aarch64-pc-windows-msvc && yarn post-build name: stable - ${{ matrix.settings.target }} - node@18 runs-on: ${{ matrix.settings.os }} diff --git a/languages/node/package.json b/languages/node/package.json index f269bf1..95e9f76 100644 --- a/languages/node/package.json +++ b/languages/node/package.json @@ -34,7 +34,8 @@ } }, "scripts": { - "build": "yarn --cwd ../../crates/infisical-napi build --target $npm_config_target && npm run move && npm run format-binding", + "build": "yarn --cwd ../../crates/infisical-napi build", + "post-build": "npm run move && npm run format-binding", "build-arm64": "npm run build-arm64 --prefix ../../crates/infisical-napi && npm run move && npm run format-binding", "build-gnu-arm64": "npm run build-gnu-arm64 --prefix ../../crates/infisical-napi && npm run move && npm run format-binding", "build-win-ia32": "npm run build-win-ia32 --prefix ../../crates/infisical-napi && npm run move-win-ia32 && npm run format-binding",