diff --git a/.github/workflows/build-helper.yml b/.github/workflows/build-helper.yml index afa3bb49d..60d298fd9 100644 --- a/.github/workflows/build-helper.yml +++ b/.github/workflows/build-helper.yml @@ -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) @@ -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. @@ -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: diff --git a/electron-builder.config.cjs b/electron-builder.config.cjs index 76a2c7860..4415b26fb 100644 --- a/electron-builder.config.cjs +++ b/electron-builder.config.cjs @@ -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: { @@ -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", @@ -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); } }, };