Enable Linux ARM builds (#127)

Adds support for building for Linux ARM targets using the new GitHub
Linux ARM64 runners. Adds a new menu item to toggle the visibility of
the menu bar on non-darwin targets,
This commit is contained in:
Evan Simkowitz 2024-07-19 16:11:08 -07:00 committed by GitHub
parent 05035b2455
commit 27266fc912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 34 additions and 22 deletions

View File

@ -14,6 +14,9 @@ jobs:
- platform: "linux"
arch: "amd64"
runner: "ubuntu-latest"
- platform: "linux"
arch: "arm64"
runner: ubuntu-22.04-arm64-4core
# - platform: "windows"
# arch: "amd64"
# runner: "windows-latest"
@ -24,7 +27,9 @@ jobs:
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm
sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools
- name: Install FPM # The version of FPM that comes bundled with electron-builder doesn't include a Linux ARM target. Installing Gems onto the runner is super quick so we'll just do this for all targets.
run: sudo gem install fpm
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
@ -48,6 +53,7 @@ jobs:
- name: Build ${{ matrix.platform }}/${{ matrix.arch }}
run: task package
env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
CSC_LINK: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_CERTIFICATE}}
CSC_KEY_PASSWORD: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_CERTIFICATE_PWD }}
APPLE_ID: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}

View File

@ -15,7 +15,6 @@ tasks:
cmds:
- yarn dev
deps:
- generate
- build:server
- build:wsh
@ -24,7 +23,6 @@ tasks:
cmds:
- yarn start
deps:
- generate
- build:server
- build:wsh
@ -35,28 +33,9 @@ tasks:
ignore_error: true
- yarn build:prod && yarn electron-builder -c electron-builder.config.cjs -p never
deps:
- generate
- build:server
- build:wsh
generate:
desc: Generate Typescript bindings for the Go backend.
cmds:
- go run cmd/generate/main-generate.go
- go run cmd/generatewshclient/main-generatewshclient.go
sources:
- "cmd/generate/*.go"
- "cmd/generatewshclient/*.go"
- "pkg/service/**/*.go"
- "pkg/wstore/*.go"
- "pkg/wshrpc/**/*.go"
- "pkg/tsgen/**/*.go"
generates:
- frontend/types/gotypes.d.ts
- pkg/wshrpc/wshclient/wshclient.go
- frontend/app/store/services.ts
- frontend/app/store/wshserver.ts
build:server:
desc: Build the wavesrv component.
deps:
@ -102,6 +81,7 @@ tasks:
generates:
- dist/bin/wavesrv.{{.GOARCH}}{{exeExt}}
deps:
- generate
- go:mod:tidy
internal: true
@ -152,9 +132,28 @@ tasks:
cmds:
- (CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -ldflags="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" -o dist/bin/wsh-{{.VERSION}}-{{.GOOS}}.{{.GOARCH}}{{.EXT}} cmd/wsh/main-wsh.go)
deps:
- generate
- go:mod:tidy
internal: true
generate:
desc: Generate Typescript bindings for the Go backend.
cmds:
- go run cmd/generate/main-generate.go
- go run cmd/generatewshclient/main-generatewshclient.go
sources:
- "cmd/generate/*.go"
- "cmd/generatewshclient/*.go"
- "pkg/service/**/*.go"
- "pkg/wstore/*.go"
- "pkg/wshrpc/**/*.go"
- "pkg/tsgen/**/*.go"
generates:
- frontend/types/gotypes.d.ts
- pkg/wshrpc/wshclient/wshclient.go
- frontend/app/store/services.ts
- frontend/app/store/wshserver.ts
go:mod:tidy:
desc: Runs `go mod tidy`
internal: true

View File

@ -577,6 +577,13 @@ function makeAppMenu() {
{
type: "separator",
},
{
label: "Toggle Menu Bar Visibility",
visible: unamePlatform != "darwin",
click: (_, window) => {
window.autoHideMenuBar = !window.autoHideMenuBar;
},
},
{
role: "hide",
},