mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Build safe-chain binaries in build.js
This commit is contained in:
parent
832708299f
commit
8c2e8c9597
2 changed files with 10 additions and 7 deletions
3
.github/workflows/create-artifact.yml
vendored
3
.github/workflows/create-artifact.yml
vendored
|
|
@ -54,7 +54,7 @@ jobs:
|
||||||
|
|
||||||
- name: Setup safe-chain
|
- name: Setup safe-chain
|
||||||
run: |
|
run: |
|
||||||
npm i -g @aikidosec/safe-chain @yao-pkg/pkg
|
npm i -g @aikidosec/safe-chain
|
||||||
safe-chain setup-ci
|
safe-chain setup-ci
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
@ -63,7 +63,6 @@ jobs:
|
||||||
- name: Create binary
|
- name: Create binary
|
||||||
run: |
|
run: |
|
||||||
node build.js ${{ matrix.target }}
|
node build.js ${{ matrix.target }}
|
||||||
pkg ./build/package.json --output "./dist/safe-chain${{ matrix.extension }}"
|
|
||||||
|
|
||||||
- name: Upload binary artifact
|
- name: Upload binary artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
|
||||||
14
build.js
14
build.js
|
|
@ -16,7 +16,7 @@ if (!target) {
|
||||||
await bundleSafeChain();
|
await bundleSafeChain();
|
||||||
await copyShellScripts();
|
await copyShellScripts();
|
||||||
await copyAndModifyPackageJson(target);
|
await copyAndModifyPackageJson(target);
|
||||||
// await buildSafeChainBinary(target);
|
await buildSafeChainBinary(target);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
async function clearOutputFolder() {
|
async function clearOutputFolder() {
|
||||||
|
|
@ -74,10 +74,14 @@ function buildSafeChainBinary(target) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error("Target: " + target);
|
console.error("Target: " + target);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const pkg = spawn("pkg", ["./build/package.json", "-t", target], {
|
const pkg = spawn(
|
||||||
stdio: "inherit",
|
"npx",
|
||||||
shell: true,
|
["@yao-pkg/pkg", "./build/package.json", "-t", target],
|
||||||
});
|
{
|
||||||
|
stdio: "inherit",
|
||||||
|
shell: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
pkg.on("close", (code) => {
|
pkg.on("close", (code) => {
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue