Skip to content

Commit

Permalink
pass arch to electron-rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
ab77 committed Dec 31, 2022
1 parent cef9b31 commit 5de9bd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/actions/publish/action.yml
Expand Up @@ -168,6 +168,19 @@ runs:
archs=(${archs})
arch_flags=$(for arch in ${archs[*]}; do echo "--${arch}"; done | tr '\n' ' ')
for arch in ${archs[*]}; do
if [[ "$arch" =~ arm ]]; then
npm ci
npm run build
os_platform="$(node -e "console.log(os.platform())")"
# (e.g.) @ronomon/direct-io/binding.node -> binding.node-darwin-arm64
find generated -type f -name binding.node \
| while read f; do cat < "${f}" > "${f%}-${os_platform}-${arch}"; done
fi
done
electron-builder "--${ELECTRON_BUILDER_OS}" ${target} ${arch_flags} \
--c.extraMetadata.analytics.sentry.token='${{ steps.sentry.outputs.dsn }}' \
--c.extraMetadata.analytics.mixpanel.token='balena-etcher' \
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -21,7 +21,7 @@
"lint-css": "prettier --write lib/**/*.css",
"lint-ts": "balena-lint --fix --typescript typings lib tests scripts/clean-shrinkwrap.ts webpack.config.ts",
"lint": "npm run lint-ts && npm run lint-css",
"postinstall": "electron-rebuild -t prod,dev,optional",
"postinstall": "bash -c 'electron-rebuild -t prod,dev,optional --arch ${arch:-x64}'",
"sanity-checks": "bash scripts/ci/ensure-all-file-extensions-in-gitattributes.sh",
"start": "./node_modules/.bin/electron .",
"test-macos": "npm run lint && npm run test-gui && npm run test-shared && npm run test-spectron && npm run sanity-checks",
Expand Down

0 comments on commit 5de9bd6

Please sign in to comment.