From c43c97ecbf33863fb632f5aa832f7a594c4155e3 Mon Sep 17 00:00:00 2001 From: Preston Date: Tue, 21 Jul 2020 17:43:52 -0400 Subject: [PATCH] Test different method for ARM builds --- .github/workflows/build.yml | 3 +++ _scripts/build.js | 10 +++++++++- package.json | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edcf5922..fb2de487 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,9 @@ jobs: - run: npm ci - run: npm run lint - run: npm run build --if-present + - name: Build ARM64 with Node.js ${{ matrix.node-version}} + if: startsWith(matrix.os, 'ubuntu') + run: npm run build:arm --if-present - name: Upload .deb Artifact uses: actions/upload-artifact@v2 if: startsWith(matrix.os, 'ubuntu') diff --git a/_scripts/build.js b/_scripts/build.js index cc15bfc1..1a96a245 100644 --- a/_scripts/build.js +++ b/_scripts/build.js @@ -2,7 +2,9 @@ const os = require('os') const builder = require('electron-builder') const Platform = builder.Platform +const Arch = builder.Arch const { name, productName } = require('../package.json') +const args = process.argv let targets var platform = os.platform() @@ -12,7 +14,13 @@ if (platform == 'darwin') { } else if (platform == 'win32') { targets = Platform.WINDOWS.createTarget() } else if (platform == 'linux') { - targets = Platform.LINUX.createTarget() + let arch = Arch.x64 + + if (args[0] === 'arm') { + arch = Arch.arm64 + } + + targets = Platform.LINUX.createTarget(['deb', 'zip', 'apk', 'rpm', 'AppImage'], arch) } const config = { diff --git a/package.json b/package.json index ace68d07..3eb9f248 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,9 @@ }, "scripts": { "build": "run-s rebuild:electron pack build-release", + "build:arm": "run-s rebuild:electron pack build-release:arm", "build-release": "node _scripts/build.js", + "build-release:arm": "node _scripts/build.js arm", "debug": "run-s rebuild:electron debug-runner", "debug-runner": "node _scripts/dev-runner.js --remote-debug", "dev": "run-s rebuild:electron dev-runner",