Files
karim ebc33a78b7 Initial commit: X-Plane G1000 web cockpit + bridge + Tauri desktop app
- server/: Node bridge (datarefs/commands, navdata, CIFP procedures, flight plan)
- web/: React cockpit (PFD/MFD/Map, VFR six-pack, AFCS, FMS CDU), PWA, collapsible sidebar
- desktop/: Tauri 2 launcher (Bun sidecar, system tray, updater) + Linux build via Docker
- scripts/: prep-desktop, build-linux, Gitea release + latest.json

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 15:07:03 +02:00

40 lines
1.9 KiB
Bash

#!/usr/bin/env bash
# Build the Linux AppImage + .deb (x86_64) in Docker. Run from the repo root,
# AFTER scripts/prep-desktop.sh has produced the linux sidecar + web resources.
# On Apple Silicon this runs under qemu (linux/amd64) and is slow but works.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
IMG=xpcockpit-linux-builder
echo "==> building docker image ($IMG)"
docker build --platform linux/amd64 -f desktop/Dockerfile.linux -t "$IMG" desktop >/dev/null
# The updater signing key is a secret and is NOT in the repo. If it's present
# locally we sign + emit updater artifacts; otherwise we build plain installable
# bundles (appimage + deb) with updater artifacts disabled via a config override.
SIGN_ENV=(); BUNDLES="appimage,deb,updater"; CFG=""
if [[ -f desktop/.tauri-signing.key && -f desktop/.tauri-signing.pw ]]; then
SIGN_ENV=(-e "TAURI_SIGNING_PRIVATE_KEY=$(cat desktop/.tauri-signing.key)"
-e "TAURI_SIGNING_PRIVATE_KEY_PASSWORD=$(cat desktop/.tauri-signing.pw)")
echo "==> signing key found — emitting signed updater artifacts"
else
BUNDLES="appimage,deb"; CFG='--config {"bundle":{"createUpdaterArtifacts":false}}'
echo "==> no signing key — building plain appimage + deb (no updater artifacts)"
fi
echo "==> tauri build (x86_64-unknown-linux-gnu) in container — this takes a while under emulation"
docker run --rm --platform linux/amd64 \
-v "$ROOT":/work \
-e CARGO_TARGET_DIR=/work/target-linux \
-e APPIMAGE_EXTRACT_AND_RUN=1 \
-e ARCH=x86_64 \
"${SIGN_ENV[@]}" \
-w /work/desktop \
"$IMG" \
bash -c "export PATH=/usr/local/cargo/bin:\$PATH; tauri build --target x86_64-unknown-linux-gnu --bundles $BUNDLES $CFG"
echo "==> artifacts:"
find target-linux/x86_64-unknown-linux-gnu/release/bundle -maxdepth 2 -type f \
\( -name '*.AppImage' -o -name '*.deb' -o -name '*.AppImage.sig' -o -name '*.tar.gz' -o -name '*.sig' \) 2>/dev/null