Build safe-chain binaries in build.js

This commit is contained in:
Sander Declerck 2025-11-28 11:31:47 +01:00
parent 832708299f
commit 8c2e8c9597
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View file

@ -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

View file

@ -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) {