From b3cbe9403f1ec0c8d809f4bcee5d2805a1f4afc4 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Mon, 4 May 2026 00:48:20 +0200 Subject: [PATCH] =?UTF-8?q?build(desktop):=20add=20electronbuild.sh=20?= =?UTF-8?q?=E2=80=94=20multi-platform=20installer=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convenience wrapper around `pnpm build:all` in packages/desktop that builds installers for mac/win/linux × arm64/x64 and collects the distributable artifacts into packages/desktop/installers/. Excluded from rsync deploy by deploy.sh. --- electronbuild.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 electronbuild.sh diff --git a/electronbuild.sh b/electronbuild.sh new file mode 100755 index 00000000..b1934a6f --- /dev/null +++ b/electronbuild.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# ============================================================ +# Backspace — Electron Installer Build Script +# ============================================================ +# Builds Electron installers for all platforms/architectures +# (macOS, Windows, Linux × arm64, x64) and copies the user- +# distributable artifacts into packages/desktop/installers/. +# +# Usage: +# ./electronbuild.sh +# ============================================================ + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DESKTOP_DIR="$REPO_ROOT/packages/desktop" +DIST_DIR="$DESKTOP_DIR/dist-electron" +INSTALLERS_DIR="$DESKTOP_DIR/installers" + +if [ ! -d "$DESKTOP_DIR" ]; then + echo "Error: $DESKTOP_DIR not found" >&2 + exit 1 +fi + +echo "==> Building Electron installers (mac/win/linux × arm64/x64)..." +cd "$DESKTOP_DIR" +pnpm build:all + +echo "==> Copying installers to $INSTALLERS_DIR" +mkdir -p "$INSTALLERS_DIR" +rm -f "$INSTALLERS_DIR"/*.dmg \ + "$INSTALLERS_DIR"/*.exe \ + "$INSTALLERS_DIR"/*.AppImage \ + "$INSTALLERS_DIR"/*.deb \ + "$INSTALLERS_DIR"/*.zip + +shopt -s nullglob +copied=0 +for ext in dmg exe AppImage deb zip; do + for f in "$DIST_DIR"/*."$ext"; do + cp "$f" "$INSTALLERS_DIR/" + copied=$((copied + 1)) + done +done +shopt -u nullglob + +if [ "$copied" -eq 0 ]; then + echo "Error: no installer artifacts found in $DIST_DIR" >&2 + exit 1 +fi + +echo "==> Done. $copied installer(s) in $INSTALLERS_DIR:" +ls -lh "$INSTALLERS_DIR" | awk 'NR>1 {printf " %-40s %s\n", $9, $5}'