From 45a4890031192f4e7409443f98e824dad17ba175 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Fri, 22 May 2026 16:19:35 +0900 Subject: feat: Arch Linux packaging with Electron frontend, systemd backend service, and Windows exe build - Add Electron wrapper (main.cjs, preload.cjs) for desktop frontend - Add systemd service unit, env config, and sysusers for backend API - Add PKGBUILD and .install for Arch package (makepkg -si) - Add desktop entry, SVG/PNG icon, and wrapper scripts - Add bin/build-pkg, bin/install-pkg, bin/windows-pkg scripts - Make API port configurable via PORT env var (default 3000, prod 18390) - Add electron-builder config for Windows exe cross-compilation - Set vite base to './' for Electron file:// loading --- bin/build-pkg | 8 ++++++++ bin/install-pkg | 15 +++++++++++++++ bin/windows-pkg | 31 +++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100755 bin/build-pkg create mode 100755 bin/install-pkg create mode 100755 bin/windows-pkg (limited to 'bin') diff --git a/bin/build-pkg b/bin/build-pkg new file mode 100755 index 0000000..904a0bb --- /dev/null +++ b/bin/build-pkg @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PACKAGING_DIR="$(dirname "$SCRIPT_DIR")/packaging" + +cd "$PACKAGING_DIR" +makepkg -fd "$@" diff --git a/bin/install-pkg b/bin/install-pkg new file mode 100755 index 0000000..89e55b2 --- /dev/null +++ b/bin/install-pkg @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PACKAGING_DIR="$(dirname "$SCRIPT_DIR")/packaging" + +PKG=$(ls -t "$PACKAGING_DIR"/dispatch-[0-9]*-x86_64.pkg.tar.zst 2>/dev/null | head -1) + +if [ -z "$PKG" ]; then + echo "No package found. Run bin/build-pkg first." >&2 + exit 1 +fi + +echo "Installing $PKG" +yay -U "$PKG" "$@" diff --git a/bin/windows-pkg b/bin/windows-pkg new file mode 100755 index 0000000..693168c --- /dev/null +++ b/bin/windows-pkg @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_DIR="$(dirname "$SCRIPT_DIR")" +FRONTEND_DIR="$PROJECT_DIR/packages/frontend" +DEST="/mnt/c/Users/micro/OneDrive/Documents/Dispatch" + +# Install deps (includes electron + electron-builder as devDependencies) +cd "$PROJECT_DIR" +bun install + +# Build frontend and package for Windows (use production port) +cd "$FRONTEND_DIR" +VITE_API_URL="http://localhost:18390" bun run dist:win + +# Find the output directory +WIN_BUILD=$(ls -d "$FRONTEND_DIR/release/win-unpacked" 2>/dev/null || true) + +if [ -z "$WIN_BUILD" ]; then + echo "Build failed: no win-unpacked directory found in release/" >&2 + exit 1 +fi + +# Copy to Windows Documents +rm -rf "$DEST" +mkdir -p "$DEST" +cp -r "$WIN_BUILD"/. "$DEST"/ + +echo "Windows build copied to: C:\\Users\\micro\\OneDrive\\Documents\\Dispatch" +echo "Run Dispatch.exe from that folder." -- cgit v1.2.3