CI / lint (push) Successful in 35s
CI / security (push) Successful in 22s
CI / test (push) Successful in 37s
CI / build (push) Successful in 13s
CI / e2e (push) Successful in 5m40s
Desktop Build / build-windows (push) Canceled after 0s
Desktop Build / build-linux (push) Canceled after 0s
127 lines
4.5 KiB
Markdown
127 lines
4.5 KiB
Markdown
# Guide de Développement, Build Local & Publication des Releases Gitea — ObsiGate
|
|
|
|
Ce guide décrit la procédure pas-à-pas pour **tester**, **compiler localement** l'application Desktop (Windows et Linux), **effectuer les commits & pushs**, puis **publier les binaires** sur la section **Releases / Publications** de Gitea (`https://git.dracodev.net/Projets/ObsiGate/releases`).
|
|
|
|
---
|
|
|
|
## 1. Tests et Prévisualisation Locale
|
|
|
|
### A. Backend & Frontend (Tests unitaires & Linting)
|
|
```powershell
|
|
# Tests backend Python (FastAPI)
|
|
.\.venv\Scripts\python.exe -m pytest tests/
|
|
|
|
# Linting backend (ruff & mypy)
|
|
.\.venv\Scripts\python.exe -m ruff check backend/
|
|
.\.venv\Scripts\python.exe -m mypy backend/ --ignore-missing-imports
|
|
|
|
# Validation & tests unitaires frontend
|
|
node tests/frontend/validate-imports.mjs
|
|
node tests/frontend/unit.test.mjs
|
|
```
|
|
|
|
### B. Mode Développement Desktop (Tauri 2 Live Preview)
|
|
Pour développer l'application desktop avec rechargement à chaud (Hot Reload) :
|
|
```powershell
|
|
cd desktop
|
|
cargo tauri dev
|
|
```
|
|
*Le backend Python et l'interface WebView Tauri démarreront automatiquement sur `http://127.0.0.1:17890`.*
|
|
|
|
---
|
|
|
|
## 2. Compilation Locale de l'Application Desktop
|
|
|
|
### A. Windows (Installeur `.exe` NSIS et Paquet `.msi`)
|
|
1. Ouvrez un terminal PowerShell ou CMD sur votre machine Windows.
|
|
2. Déplacez-vous dans le dossier `desktop/` et exécutez le script :
|
|
```powershell
|
|
cd desktop
|
|
.\build-windows.bat
|
|
```
|
|
3. **Binaires générés dans** `desktop/target/x86_64-pc-windows-msvc/release/bundle/` :
|
|
- `ObsiGate_x.y.z_x64-setup.exe` (Installeur utilisateur NSIS)
|
|
- `ObsiGate_x.y.z_x64_en-US.msi` (Paquet d'installation MSI)
|
|
|
|
### B. Linux (Exécutable `.AppImage` et Paquet `.deb`)
|
|
1. Ouvrez un terminal Bash (Machine Linux ou WSL2 / Conteneur Docker).
|
|
2. Déplacez-vous dans le dossier `desktop/` et exécutez le script :
|
|
```bash
|
|
cd desktop
|
|
chmod +x build-linux.sh
|
|
./build-linux.sh
|
|
```
|
|
3. **Binaires générés dans** `desktop/target/x86_64-unknown-linux-gnu/release/bundle/` :
|
|
- `ObsiGate_x.y.z_amd64.AppImage` (Exécutable portable Linux)
|
|
- `obsigate_x.y.z_amd64.deb` (Paquet Debian/Ubuntu)
|
|
|
|
---
|
|
|
|
## 3. Commit, Push & Tagging Git
|
|
|
|
Une fois les modifications testées et validées :
|
|
|
|
1. **Commit et Push du code source** :
|
|
```bash
|
|
git add .
|
|
git commit -m "feat: préparation release v2.0.0"
|
|
git push origin main
|
|
```
|
|
*Ceci déclenchera la vérification CI standard sur Gitea (lint, tests unitaires, build Docker).*
|
|
|
|
2. **Création du Tag de Version** :
|
|
```bash
|
|
git tag -a v2.0.0 -m "Release v2.0.0"
|
|
git push origin v2.0.0
|
|
```
|
|
|
|
---
|
|
|
|
## 4. Publication des Binaires sur Gitea Releases
|
|
|
|
Un script automatisé (`scripts/publish_release.py`) se charge de téléverser vos binaires compilés localement et de générer l'empreinte cryptographique `checksums.txt` (SHA256).
|
|
|
|
### A. Obtenir un Jeton d'Accès Gitea (Une seule fois)
|
|
1. Connectez-vous sur votre instance Gitea : `https://git.dracodev.net`.
|
|
2. Cliquez sur votre **Profil** $\rightarrow$ **Paramètres** $\rightarrow$ **Applications**.
|
|
3. Dans **Gérer les jetons d'accès personnels**, entrez le nom `ObsiGate-Release` et cochez le jeton avec accès en écriture sur les dépôts (`repo`).
|
|
4. Copiez le jeton généré.
|
|
|
|
### B. Exécution de la Publication
|
|
|
|
**Option 1 — Définir la variable d'environnement (Recommandé) :**
|
|
- **Windows PowerShell** :
|
|
```powershell
|
|
$env:GITEA_TOKEN="votre_jeton_gitea_ici"
|
|
.\.venv\Scripts\python.exe scripts/publish_release.py --tag v2.0.0
|
|
```
|
|
- **Linux / Bash** :
|
|
```bash
|
|
export GITEA_TOKEN="votre_jeton_gitea_ici"
|
|
python3 scripts/publish_release.py --tag v2.0.0
|
|
```
|
|
|
|
**Option 2 — Utiliser l'option `--token` :**
|
|
```powershell
|
|
.\.venv\Scripts\python.exe scripts/publish_release.py --tag v2.0.0 --token "votre_jeton_gitea_ici"
|
|
```
|
|
|
|
**Option 3 — Tester à blanc avec `--dry-run` (Sans modifier Gitea) :**
|
|
```powershell
|
|
.\.venv\Scripts\python.exe scripts/publish_release.py --tag v2.0.0 --dry-run
|
|
```
|
|
|
|
---
|
|
|
|
## 5. Résultat Attendu dans Gitea
|
|
|
|
Une fois le script exécuté, visitez la page [ObsiGate Releases](https://git.dracodev.net/Projets/ObsiGate/releases).
|
|
|
|
Vous y trouverez la section de publication officielle contenant :
|
|
- 📦 `ObsiGate_2.0.0_x64-setup.exe` (Installeur Windows)
|
|
- 📦 `ObsiGate_2.0.0_x64_en-US.msi` (Package MSI Windows)
|
|
- 📦 `ObsiGate_2.0.0_amd64.AppImage` (Executable autonome Linux)
|
|
- 📦 `obsigate_2.0.0_amd64.deb` (Paquet Debian/Ubuntu)
|
|
- 🔐 `checksums.txt` (Empreintes de sécurité SHA-256)
|
|
- 📄 Code source `.zip` / `.tar.gz` (générés automatiquement)
|