Skip to content

Commit

Permalink
Snap support (#1095)
Browse files Browse the repository at this point in the history
Adds Snap support, though I'm still waiting to hear back from the
Snapcraft team about getting our package listed.

closes #1092
  • Loading branch information
esimkowitz authored Oct 22, 2024
1 parent 1fc6dd7 commit 81a8a7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools
# We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
- name: Setup Zig (Linux only)
if: matrix.platform == 'linux'
run: sudo snap install zig --classic --beta
sudo snap install snapcraft --classic
sudo snap install zig --classic --beta # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
# The pre-installed version of the AWS CLI has a segfault problem so we'll install it via Homebrew instead.
- name: Upgrade AWS CLI (Mac only)
Expand Down Expand Up @@ -122,8 +119,15 @@ jobs:
path: ${{env.STATIC_DOCSITE_PATH}}

# Build and upload packages
- name: Build (not Windows)
if: matrix.platform != 'windows'
- name: Build (Linux)
if: matrix.platform == 'linux'
run: task package
env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
SNAPCRAFT_BUILD_ENVIRONMENT: host
- name: Build (Darwin)
if: matrix.platform == 'darwin'
run: task package
env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
Expand All @@ -133,7 +137,7 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_PWD_2 }}
APPLE_TEAM_ID: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_TEAM_ID_2 }}
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
- name: Build (Windows only)
- name: Build (Windows)
if: matrix.platform == 'windows'
run: task package
env:
Expand Down
10 changes: 6 additions & 4 deletions electron-builder.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const config = {
artifactName: "${name}-${platform}-${arch}-${version}.${ext}",
category: "TerminalEmulator",
executableName: pkg.name,
target: ["zip", "deb", "rpm", "AppImage", "pacman"],
target: ["zip", "deb", "rpm", "snap", "AppImage", "pacman"],
synopsis: pkg.description,
description: null,
desktop: {
Expand All @@ -84,6 +84,11 @@ const config = {
appImage: {
license: "LICENSE",
},
snap: {
base: "core22",
confinement: "classic",
allowNativeWayland: true,
},
publish: {
provider: "generic",
url: "https://dl.waveterm.dev/releases-w2",
Expand Down Expand Up @@ -111,9 +116,6 @@ const config = {
})
.filter((f) => f.isFile() && f.name.startsWith("wavesrv"))
.forEach((f) => fs.chmodSync(path.resolve(f.parentPath ?? f.path, f.name), 0o755)); // 0o755 corresponds to -rwxr-xr-x
} else if (context.electronPlatformName === "linux") {
const chromeSandboxPath = path.resolve(context.appOutDir, "chrome-sandbox");
fs.chmodSync(chromeSandboxPath, 0o4755);
}
},
};
Expand Down

0 comments on commit 81a8a7f

Please sign in to comment.