feat(desktop): manifeste de mise a jour latest.json + builds locaux signes (#77)
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
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
- 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).
This commit is contained in:
+15
-7
@@ -303,18 +303,26 @@ Indépendante de la signature Windows, la signature des mises à jour Tauri repo
|
||||
sur une paire de clés que vous générez vous-même :
|
||||
|
||||
```bash
|
||||
cargo tauri signer generate -w ~/.tauri/obsigate.key
|
||||
cargo tauri signer generate -w obsigate-updater.key
|
||||
```
|
||||
|
||||
- La **clé publique** est déjà renseignée dans `plugins.updater.pubkey`
|
||||
(`tauri.conf.json`).
|
||||
- La **clé privée** doit être exposée au build via `TAURI_SIGNING_PRIVATE_KEY`
|
||||
(jamais commitée) ; dans le CI, via les secrets Gitea
|
||||
`TAURI_SIGNING_PRIVATE_KEY` / `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`.
|
||||
- Le CLI produit des `.sig` par artefact (`*.msi.sig`, `*.AppImage.sig`, …).
|
||||
- La **clé privée** (`desktop/obsigate-updater.key`, gitignorée) est lue
|
||||
automatiquement par `build-windows.bat` / `build-linux.sh` ; en CI, via les
|
||||
secrets Gitea `TAURI_SIGNING_PRIVATE_KEY` / `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`.
|
||||
- Le CLI produit des `.sig` par artefact (`*.exe.sig`, `*.AppImage.sig`, …).
|
||||
|
||||
> Le manifeste `latest.json` consommé par l'updater n'est pas généré par le CLI :
|
||||
> voir [DEVELOPMENT_AND_RELEASES §2bis](../docs/DEVELOPMENT_AND_RELEASES.md#2bis-signature-des-mises-à-jour-updater-tauri).
|
||||
**Manifeste `latest.json`** (détection des mises à jour) :
|
||||
|
||||
```powershell
|
||||
python scripts\updater_manifest.py --tag vX.Y.Z # ou via publish_release.py
|
||||
```
|
||||
|
||||
`publish_release.py` le génère et l'ajoute aux assets ; il reste à **committer
|
||||
`desktop/latest.json` sur `main`**. L'updater lit ce fichier versionné :
|
||||
`https://git.dracodev.net/Projets/ObsiGate/raw/branch/main/desktop/latest.json`.
|
||||
Détail : [DEVELOPMENT_AND_RELEASES §2bis](../docs/DEVELOPMENT_AND_RELEASES.md#2bis-signature-des-mises-à-jour-updater-tauri).
|
||||
|
||||
---
|
||||
|
||||
|
||||
+11
-1
@@ -38,9 +38,19 @@ 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
|
||||
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 ───────────────
|
||||
|
||||
@@ -51,12 +51,23 @@ xcopy /E /I /Q /Y "..\backend" "backend"
|
||||
xcopy /E /I /Q /Y "..\frontend" "frontend"
|
||||
echo ✅ Staged
|
||||
|
||||
REM ── 2c. Clé de signature des mises à jour (updater Tauri) ──────
|
||||
set "SIGN_CONFIG="
|
||||
if exist "obsigate-updater.key" (
|
||||
set /p TAURI_SIGNING_PRIVATE_KEY=<obsigate-updater.key
|
||||
echo [2c/6] Cle updater trouvee - artefacts .sig actives
|
||||
) else (
|
||||
> updater-off.json echo {"bundle":{"createUpdaterArtifacts":false}}
|
||||
set "SIGN_CONFIG=--config updater-off.json"
|
||||
echo [2c/6] Cle updater absente - build sans .sig
|
||||
)
|
||||
|
||||
REM ── 3. Build Tauri ────────────────────────────────────────────
|
||||
echo [3/6] Building Tauri application (NSIS + MSI installers)...
|
||||
cargo tauri build --target x86_64-pc-windows-msvc --bundles nsis,msi
|
||||
cargo tauri build --target x86_64-pc-windows-msvc --bundles nsis,msi %SIGN_CONFIG%
|
||||
if errorlevel 1 (
|
||||
echo ⚠️ Standard bundle build failed, trying fallback to NSIS only...
|
||||
cargo tauri build --target x86_64-pc-windows-msvc --bundles nsis
|
||||
cargo tauri build --target x86_64-pc-windows-msvc --bundles nsis %SIGN_CONFIG%
|
||||
if errorlevel 1 (
|
||||
echo ❌ Build failed!
|
||||
goto :cleanup
|
||||
@@ -77,6 +88,7 @@ REM ── 5. Nettoyer les dossiers stagés ────────────
|
||||
echo [5/6] Cleaning up staged dirs...
|
||||
if exist "backend" rmdir /s /q "backend"
|
||||
if exist "frontend" rmdir /s /q "frontend"
|
||||
if exist "updater-off.json" del /q "updater-off.json"
|
||||
echo ✅ Cleaned
|
||||
|
||||
REM ── 6. Résultats ───────────────────────────────────────────────
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
"store": null,
|
||||
"updater": {
|
||||
"endpoints": [
|
||||
"https://git.dracodev.net/api/v1/repos/Projets/ObsiGate/releases/latest"
|
||||
"https://git.dracodev.net/Projets/ObsiGate/raw/branch/main/desktop/latest.json"
|
||||
],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDcwQjU2MDM4QUVEREY3NApSV1IwMysyS0ExWUxCK1RQMUgrYnplQWlpYWU2SHVYajVIUHhzNEFKLzZ2Z2puZW9pSUQ2RE8rUAo=",
|
||||
"windows": {
|
||||
|
||||
Reference in New Issue
Block a user