Skip to content

Commit a1f65e8

Browse files
authored
update support for Linux installers (#1731)
* test linux build on ubuntu 22 * fix build flow * add image * update image * update script * more updates * try to revert electron builder * remove notarize property * update package lock * put builder back * try deb only * revert builder config * remove windows and mac targets * remove tar and snap * put tar back * tar without arm * put snap back * put it all back except arm * do it on ubuntu 22 * move images to dev tools * try arm build * add debug * add line number * try arm again * break up config files * update workflow * fix syntax * put it all together * clean up build scripts * put notarize back * fix postinstall script * revert package lock
1 parent 71bb1de commit a1f65e8

7 files changed

+90
-51
lines changed

.github/workflows/build.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
os:
39-
- ubuntu-latest
39+
- ubuntu-20.04
40+
- ubuntu-22.04-arm
4041
include:
4142
- os: macos-13
4243
cert_key: APPLE_DEVELOPER_SIGNING_CERTIFICATE
@@ -64,12 +65,12 @@ jobs:
6465
node-version: 18.12.1
6566
cache: 'npm'
6667
- name: install Linux dev tools
67-
if: matrix.os == 'ubuntu-latest'
68+
if: startsWith(matrix.os, 'ubuntu')
6869
run: |
6970
sudo apt update -y
7071
sudo apt install -y libudev-dev
7172
- name: install Macos dev tools
72-
if: matrix.os == 'macos-13'
73+
if: startsWith(matrix.os, 'macos')
7374
run: |
7475
sudo -H pip install setuptools
7576
- name: create NPM config file
@@ -82,4 +83,9 @@ jobs:
8283
- name: Sleep for 4 seconds
8384
shell: bash
8485
run: sleep 4
85-
- run: npm run publish
86+
- name: Publish
87+
if: ${{ startsWith(matrix.os, 'ubuntu') && endsWith(matrix.os, 'arm') }}
88+
run: npm run publish:linux:arm64
89+
- name: Publish
90+
if: ${{ !startsWith(matrix.os, 'ubuntu') || !endsWith(matrix.os, 'arm') }}
91+
run: npm run publish

build/electron-builder-base.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const config = {
2+
appId: 'sh.frame.app',
3+
productName: 'Frame',
4+
files: ['compiled', 'bundle', '!compiled/main/dev']
5+
}
6+
7+
module.exports = config

build/electron-builder-linux-arm64.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// build config for linux arm64
2+
3+
const baseConfig = require('./electron-builder-base.js')
4+
5+
const config = {
6+
...baseConfig,
7+
linux: {
8+
target: [
9+
{
10+
target: 'AppImage',
11+
arch: ['arm64']
12+
},
13+
{
14+
target: 'tar.gz',
15+
arch: ['arm64']
16+
}
17+
]
18+
}
19+
}
20+
21+
module.exports = config

build/electron-builder-standard.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// build config for every platform and architecture EXCEPT linux arm64
2+
3+
const baseConfig = require('./electron-builder-base.js')
4+
5+
const config = {
6+
...baseConfig,
7+
afterSign: './build/notarize.js',
8+
linux: {
9+
target: [
10+
{
11+
target: 'AppImage',
12+
arch: ['x64']
13+
},
14+
{
15+
target: 'deb',
16+
arch: ['x64']
17+
},
18+
{
19+
target: 'snap',
20+
arch: ['x64']
21+
},
22+
{
23+
target: 'tar.gz',
24+
arch: ['x64']
25+
}
26+
]
27+
},
28+
mac: {
29+
target: {
30+
target: 'default',
31+
arch: ['x64', 'arm64']
32+
},
33+
notarize: false,
34+
hardenedRuntime: true,
35+
gatekeeperAssess: false,
36+
entitlements: 'build/entitlements.mac.plist',
37+
requirements: 'build/electron-builder-requirements.txt'
38+
},
39+
win: {
40+
publisherName: 'Frame Labs, Inc.',
41+
signAndEditExecutable: true,
42+
icon: 'build/icons/icon.png'
43+
}
44+
}
45+
46+
module.exports = config

electron-builder.json

-42
This file was deleted.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frame",
3-
"version": "0.6.10",
3+
"version": "0.6.11",
44
"description": "System-wide web3",
55
"main": "compiled/main",
66
"scripts": {
@@ -37,10 +37,11 @@
3737
"prod": "npm run compile && npm run bundle && npm run launch",
3838
"compile": "npm run copy-assets && tsc --project tsconfig.build.json",
3939
"compile:watch": "npm run copy-assets && tsc --project tsconfig.build.json -w",
40-
"build": "npm run compile && sleep 4 && npm run bundle && sleep 4 && electron-builder",
40+
"build": "npm run compile && sleep 4 && npm run bundle && sleep 4 && electron-builder --config=build/electron-builder-standard.js",
4141
"copy-assets": "shx mkdir -p ./compiled/main/windows && shx cp ./main/windows/*.png ./compiled/main/windows",
4242
"parcel:build": "parcel build --no-autoinstall --public-url .",
43-
"publish": "electron-builder -c.snap.publish=github",
43+
"publish": "electron-builder -c.snap.publish=github --config=build/electron-builder-standard.js",
44+
"publish:linux:arm64": "electron-builder -c.snap.publish=github --config=build/electron-builder-linux-arm64.js",
4445
"release": "npm run compile && sleep 4 && npm run bundle && sleep 4 && npm run publish",
4546
"postinstall": "electron-builder install-app-deps",
4647
"test": "npm run test:unit && npm run test:e2e",

0 commit comments

Comments
 (0)