Skip to content

Commit 81a8a7f

Browse files
authored
Snap support (#1095)
Adds Snap support, though I'm still waiting to hear back from the Snapcraft team about getting our package listed. closes #1092
1 parent 1fc6dd7 commit 81a8a7f

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.github/workflows/build-helper.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ jobs:
4040
run: |
4141
sudo apt-get update
4242
sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools
43-
44-
# We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
45-
- name: Setup Zig (Linux only)
46-
if: matrix.platform == 'linux'
47-
run: sudo snap install zig --classic --beta
43+
sudo snap install snapcraft --classic
44+
sudo snap install zig --classic --beta # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
4845
4946
# The pre-installed version of the AWS CLI has a segfault problem so we'll install it via Homebrew instead.
5047
- name: Upgrade AWS CLI (Mac only)
@@ -122,8 +119,15 @@ jobs:
122119
path: ${{env.STATIC_DOCSITE_PATH}}
123120

124121
# Build and upload packages
125-
- name: Build (not Windows)
126-
if: matrix.platform != 'windows'
122+
- name: Build (Linux)
123+
if: matrix.platform == 'linux'
124+
run: task package
125+
env:
126+
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
127+
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
128+
SNAPCRAFT_BUILD_ENVIRONMENT: host
129+
- name: Build (Darwin)
130+
if: matrix.platform == 'darwin'
127131
run: task package
128132
env:
129133
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
@@ -133,7 +137,7 @@ jobs:
133137
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_PWD_2 }}
134138
APPLE_TEAM_ID: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_TEAM_ID_2 }}
135139
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
136-
- name: Build (Windows only)
140+
- name: Build (Windows)
137141
if: matrix.platform == 'windows'
138142
run: task package
139143
env:

electron-builder.config.cjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const config = {
5858
artifactName: "${name}-${platform}-${arch}-${version}.${ext}",
5959
category: "TerminalEmulator",
6060
executableName: pkg.name,
61-
target: ["zip", "deb", "rpm", "AppImage", "pacman"],
61+
target: ["zip", "deb", "rpm", "snap", "AppImage", "pacman"],
6262
synopsis: pkg.description,
6363
description: null,
6464
desktop: {
@@ -84,6 +84,11 @@ const config = {
8484
appImage: {
8585
license: "LICENSE",
8686
},
87+
snap: {
88+
base: "core22",
89+
confinement: "classic",
90+
allowNativeWayland: true,
91+
},
8792
publish: {
8893
provider: "generic",
8994
url: "https://dl.waveterm.dev/releases-w2",
@@ -111,9 +116,6 @@ const config = {
111116
})
112117
.filter((f) => f.isFile() && f.name.startsWith("wavesrv"))
113118
.forEach((f) => fs.chmodSync(path.resolve(f.parentPath ?? f.path, f.name), 0o755)); // 0o755 corresponds to -rwxr-xr-x
114-
} else if (context.electronPlatformName === "linux") {
115-
const chromeSandboxPath = path.resolve(context.appOutDir, "chrome-sandbox");
116-
fs.chmodSync(chromeSandboxPath, 0o4755);
117119
}
118120
},
119121
};

0 commit comments

Comments
 (0)