Files
bruno 8ddee212e5
CI / lint (push) Successful in 1m7s
CI / security (push) Successful in 43s
CI / test (push) Successful in 2m12s
CI / build (push) Successful in 42s
CI / e2e (push) Successful in 10m43s
Desktop Build / build-windows (push) Canceled after 0s
Desktop Build / build-linux (push) Canceled after 0s
feat(desktop): manifeste de mise a jour latest.json + builds locaux signes (#77)
- scripts/updater_manifest.py : construit latest.json (version, pub_date, platforms Windows/Linux avec signature .sig et URLs des assets).

- publish_release.py : genere latest.json, upload des .sig + latest.json, rappel de commit.

- tauri.conf.json : endpoint updater -> raw/branch/main/desktop/latest.json.

- build-windows.bat / build-linux.sh : detection automatique de obsigate-updater.key (signature) ou repli non signe.

- .gitignore : ignore desktop/key/ ; tests/test_updater_manifest.py (8 tests).
2026-09-12 10:01:56 -04:00

76 lines
3.4 KiB
Bash
Executable File

#!/bin/bash
# ============================================================
# ObsiGate Desktop — Build Linux (.deb + .AppImage)
# Prérequis : Rust, Tauri CLI, libwebkit2gtk, Python 3.11
# ============================================================
set -e
echo "========================================"
echo " ObsiGate Desktop — Build Linux"
echo "========================================"
echo ""
# ── 1. Vérifier les prérequis ─────────────────────────────────
echo "[1/5] Verifying prerequisites..."
command -v cargo >/dev/null 2>&1 || { echo "❌ Rust/Cargo not found. Install: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"; exit 1; }
command -v tauri >/dev/null 2>&1 || cargo install tauri-cli
# Check system deps
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev curl 2>/dev/null
fi
echo "✅ Dependencies OK"
# ── 2. Préparer Python 3.11 ────────────────────────────────────
echo "[2/5] Preparing Python environment..."
python3 -m venv python-embed/venv
source python-embed/venv/bin/activate
pip install --upgrade pip -q
pip install -r ../backend/requirements.txt -q
echo "✅ Python environment ready"
# ── 2b. Stage backend + frontend pour le bundle ───────────────
# tauri.conf.json embarque backend/** et frontend/** depuis desktop/ :
# sans ce staging, tauri_build échoue (« glob pattern backend/**/* path not found »).
echo "[2b/5] Staging backend + frontend for bundle..."
rm -rf backend frontend
cp -r ../backend backend
cp -r ../frontend frontend
echo "✅ Staged"
# ── 2c. Clé de signature des mises à jour (updater Tauri) ──────
if [ -f "obsigate-updater.key" ]; then
export TAURI_SIGNING_PRIVATE_KEY="$(cat obsigate-updater.key)"
SIGN_CONFIG=""
echo "[2c/5] Clé updater trouvée — artefacts .sig activés"
else
SIGN_CONFIG='--config {"bundle":{"createUpdaterArtifacts":false}}'
echo "[2c/5] Clé updater absente — build sans .sig"
fi
# ── 3. Build Tauri ────────────────────────────────────────────
echo "[3/5] Building Tauri application..."
cargo tauri build --target x86_64-unknown-linux-gnu --bundles deb,appimage $SIGN_CONFIG
echo "✅ Build successful"
# ── 4. Copier le runtime à côté de l'exécutable ───────────────
OUTDIR="target/x86_64-unknown-linux-gnu/release"
echo "[4/5] Copying runtime to $OUTDIR..."
rm -rf "$OUTDIR/python-embed" "$OUTDIR/backend" "$OUTDIR/frontend"
cp -r python-embed "$OUTDIR/"
cp -r ../backend "$OUTDIR/"
cp -r ../frontend "$OUTDIR/"
echo "✅ Runtime + frontend copied"
# ── 4b. Nettoyer les dossiers stagés ──────────────────────────
rm -rf backend frontend
echo "✅ Cleaned"
# ── 5. Résultats ───────────────────────────────────────────────
OUTDIR="target/x86_64-unknown-linux-gnu/release"
echo "[5/5] Results:"
ls -lh "$OUTDIR/bundle/deb/"*.deb 2>/dev/null
ls -lh "$OUTDIR/bundle/appimage/"*.AppImage 2>/dev/null
echo ""
echo "✅ Done! Check $OUTDIR/bundle/"