Skip to content

Commit

Permalink
re{build,pack} node-usb|lzma-native for arm*
Browse files Browse the repository at this point in the history
  • Loading branch information
ab77 committed Dec 22, 2022
1 parent 78c60a8 commit 5077e19
Show file tree
Hide file tree
Showing 6 changed files with 23,454 additions and 712 deletions.
51 changes: 50 additions & 1 deletion .github/actions/publish/action.yml
Expand Up @@ -15,7 +15,7 @@ inputs:
default: "accounts+apple@balena.io"
NODE_VERSION:
type: string
default: "14.x"
default: "16.x"
VERBOSE:
type: string
default: "true"
Expand Down Expand Up @@ -173,6 +173,54 @@ runs:
--c.extraMetadata.analytics.mixpanel.token='balena-etcher' \
--c.extraMetadata.packageType="${target}"
# fix pre-built binaries for ARM* and re{build,package}
# https://github.com/Pi-Apps-Coders/files/blob/main/CompileCommands.md#balenaetcher
# https://github.com/theofficialgman
for arch in ${archs[*]}; do
npm run flowzone-preinstall-${runner_os}
if [[ "$arch" =~ arm|aarch ]]; then
# limit node memory usage for older RPi models
if [[ "$arch" =~ v7 ]]; then
NODE_OPTIONS='--max-old-space-size=1024'
fi
# correct the broken pre-built for the usb node module
pushd node_modules/usb
rm -rf prebuilds/linux-arm*/node.napi.armv*.node
npm install && npm run prebuild
find prebuilds
# rename the file so other programs are happy
pushd prebuilds/linux-${arch}
if [[ "$arch" =~ v7 ]]; then
mv node.napi.node node.napi.armv7.node
else
mv node.napi.node node.napi.armv8.node
fi
popd && popd
# correct the broken lzma-native package (they ship x86_64 binaries under the ARM64 name ): )
pushd node_modules/lzma-native
npm install && npm run prebuild
popd
# now start probably won't work so we will just package and then you can test the appimage
npm run webpack
# re{build,package}
ELECTRON_BUILDER_ARCHITECTURE=${arch} electron-builder \
electron-builder "--${ELECTRON_BUILDER_OS}" ${target} --${arch} \
--c.extraMetadata.analytics.sentry.token='${{ steps.sentry.outputs.dsn }}' \
--c.extraMetadata.analytics.mixpanel.token='balena-etcher' \
--c.extraMetadata.packageType="${target}"
fi
done
find dist -type f -maxdepth 1
done
Expand All @@ -188,6 +236,7 @@ runs:
# https://www.electron.build/#debug
FPM_DEBUG: 1
DEBUG: electron-builder
USE_SYSTEM_FPM: true

# https://www.electron.build/auto-update.html#staged-rollouts
- name: Configure staged rollout(s)
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test/action.yml
Expand Up @@ -12,7 +12,7 @@ inputs:
# --- custom environment
NODE_VERSION:
type: string
default: "14.x"
default: "16.x"
VERBOSE:
type: string
default: "true"
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/app/i18n/en.ts
Expand Up @@ -138,7 +138,8 @@ const translation = {
autoUpdate: 'Auto-updates enabled',
settings: 'Settings',
systemInformation: 'System Information',
trimExtPartitions: 'Trim unallocated space on raw images (in ext-type partitions)',
trimExtPartitions:
'Trim unallocated space on raw images (in ext-type partitions)',
},
menu: {
edit: 'Edit',
Expand Down

0 comments on commit 5077e19

Please sign in to comment.