diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edcf5922c..fb2de4872 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 cc15bfc14..1a96a245b 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 ace68d07a..3eb9f2489 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",