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:
@@ -26,6 +26,9 @@ import urllib.error
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
||||
from updater_manifest import build_updater_manifest
|
||||
|
||||
DEFAULT_GITEA_URL = "https://git.dracodev.net"
|
||||
DEFAULT_REPO = "Projets/ObsiGate"
|
||||
|
||||
@@ -66,9 +69,13 @@ def find_desktop_binaries(base_dir: pathlib.Path) -> list[pathlib.Path]:
|
||||
"""Recherche les binaires Desktop générés par Tauri dans le répertoire desktop/."""
|
||||
patterns = [
|
||||
"target/**/release/bundle/nsis/*.exe",
|
||||
"target/**/release/bundle/nsis/*.exe.sig",
|
||||
"target/**/release/bundle/msi/*.msi",
|
||||
"target/**/release/bundle/msi/*.msi.sig",
|
||||
"target/**/release/bundle/appimage/*.AppImage",
|
||||
"target/**/release/bundle/appimage/*.AppImage.sig",
|
||||
"target/**/release/bundle/deb/*.deb",
|
||||
"target/**/release/bundle/deb/*.deb.sig",
|
||||
"release_assets/*",
|
||||
]
|
||||
|
||||
@@ -173,6 +180,10 @@ def upload_asset_to_gitea(
|
||||
content_type = "application/vnd.debian.binary-package"
|
||||
elif filename.endswith(".txt"):
|
||||
content_type = "text/plain"
|
||||
elif filename.endswith(".json"):
|
||||
content_type = "application/json"
|
||||
elif filename.endswith(".sig"):
|
||||
content_type = "text/plain"
|
||||
|
||||
body = []
|
||||
body.append(f"--{boundary}".encode("utf-8"))
|
||||
@@ -258,6 +269,22 @@ def main():
|
||||
all_files_to_upload.append(checksums_path)
|
||||
print(" ✅ checksums.txt généré avec succès")
|
||||
|
||||
# 2b. Génération du manifeste de mise à jour Tauri (latest.json)
|
||||
latest_path = root_dir / "desktop" / "latest.json"
|
||||
print(f"\n🔄 Génération du manifeste de mise à jour ({latest_path.name})...")
|
||||
manifest = build_updater_manifest(
|
||||
root_dir / "desktop", tag, gitea_url, repo, notes=args.notes or ""
|
||||
)
|
||||
if manifest:
|
||||
latest_path.write_text(
|
||||
json.dumps(manifest, indent=2, ensure_ascii=False) + "\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
all_files_to_upload.append(latest_path)
|
||||
print(f" ✅ latest.json généré ({', '.join(manifest['platforms'])})")
|
||||
else:
|
||||
print(" ⚠️ Aucun artefact signé (.sig) — latest.json non généré.")
|
||||
|
||||
if args.dry_run:
|
||||
print("\n🧪 Mode Dry-Run terminé. Aucune action distante effectuée.")
|
||||
return 0
|
||||
@@ -338,6 +365,11 @@ def main():
|
||||
print("\n==========================================================")
|
||||
print(f" 🎉 Publication terminée avec succès sur Gitea !")
|
||||
print(f" 🔗 {gitea_url}/{repo}/releases/tag/{tag}")
|
||||
if latest_path.exists():
|
||||
print("\n⚠️ Dernière étape : publier le manifeste de mise à jour")
|
||||
print(f" git add desktop/latest.json && git commit -m \"chore: latest.json {tag}\"")
|
||||
print(" git push origin main")
|
||||
print(" (l'updater lit desktop/latest.json sur la branche main)")
|
||||
print("==========================================================")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user