From 8c2e8c959760a391a52557bf8487aa16bc11538f Mon Sep 17 00:00:00 2001 From: Sander Declerck Date: Fri, 28 Nov 2025 11:31:47 +0100 Subject: [PATCH] Build safe-chain binaries in build.js --- .github/workflows/create-artifact.yml | 3 +-- build.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-artifact.yml b/.github/workflows/create-artifact.yml index 63badb5..6d479c7 100644 --- a/.github/workflows/create-artifact.yml +++ b/.github/workflows/create-artifact.yml @@ -54,7 +54,7 @@ jobs: - name: Setup safe-chain run: | - npm i -g @aikidosec/safe-chain @yao-pkg/pkg + npm i -g @aikidosec/safe-chain safe-chain setup-ci - name: Install dependencies @@ -63,7 +63,6 @@ jobs: - name: Create binary run: | node build.js ${{ matrix.target }} - pkg ./build/package.json --output "./dist/safe-chain${{ matrix.extension }}" - name: Upload binary artifact uses: actions/upload-artifact@v4 diff --git a/build.js b/build.js index 7c5ac27..5dc7254 100644 --- a/build.js +++ b/build.js @@ -16,7 +16,7 @@ if (!target) { await bundleSafeChain(); await copyShellScripts(); await copyAndModifyPackageJson(target); - // await buildSafeChainBinary(target); + await buildSafeChainBinary(target); })(); async function clearOutputFolder() { @@ -74,10 +74,14 @@ function buildSafeChainBinary(target) { // eslint-disable-next-line no-console console.error("Target: " + target); return new Promise((resolve, reject) => { - const pkg = spawn("pkg", ["./build/package.json", "-t", target], { - stdio: "inherit", - shell: true, - }); + const pkg = spawn( + "npx", + ["@yao-pkg/pkg", "./build/package.json", "-t", target], + { + stdio: "inherit", + shell: true, + } + ); pkg.on("close", (code) => { if (code !== 0) {