From 69139376655ed0c6d8fcd6a4129074d3b0e04a8b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 25 Oct 2024 20:49:42 -0700 Subject: [PATCH] fix: pack zeromq on the main CI --- .github/workflows/CI.yml | 17 +++++++++++------ package.json | 1 + script/smoke-test.bash | 5 ++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 035e0dd1..19c32d4e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -162,12 +162,17 @@ jobs: name: build-${{ strategy.job-index }} overwrite: true - - name: Upload lib + - name: Pack Zeromq + if: matrix.os == 'ubuntu-20.04' + run: | + pnpm pack + + - name: Upload Pack if: matrix.os == 'ubuntu-20.04' uses: actions/upload-artifact@v4 with: - path: ./lib - name: lib + path: ./*.tgz + name: pack overwrite: true - name: Lint @@ -228,11 +233,11 @@ jobs: name: build path: ./build - - name: Place lib + - name: Place Pack uses: actions/download-artifact@v4 with: - name: lib - path: ./lib + name: pack + path: ./ - name: Install Node uses: actions/setup-node@v4 diff --git a/package.json b/package.json index 8ffba347..cd350a9a 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "lint": "run-p format lint.eslint format", "lint-test": "run-s lint-test.eslint", "bench": "node --expose-gc test/bench", + "prepublishOnly": "pnpm run build.js", "bump": "pnpx npm-check-updates -u -x typescript,eslint,chai && pnpx typesync && pnpm update" }, "cmake-ts": { diff --git a/script/smoke-test.bash b/script/smoke-test.bash index ee293390..25f6894a 100755 --- a/script/smoke-test.bash +++ b/script/smoke-test.bash @@ -2,11 +2,10 @@ set -ev set -o pipefail -echo "Pack zeromq.js" +echo "Pack zeromq.js if needed" version=$(npm pkg get version | tr -d '"') pack_name="zeromq-${version}.tgz" -rm -f "${pack_name}" -npm pack +test -f "${pack_name}" || npm pack init_smoke_test() { local pm=$1