# CI build app technicien (Gitea Actions, git.targo.ca) Usine de build : **push → APK Android** téléchargeable en artefact. iOS prévu (runner macOS + compte Apple). Workflows : `.gitea/workflows/field-tech-android.yml` + `field-tech-ios.yml`. ## 1. Activer Actions - Admin Gitea : `Site Administration → Actions` activé. - Dépôt `louis/gigafibre-fsm` : `Settings → Actions → Enable`. ## 2. Runner Linux (Android) — sur un hôte HORS prod > Le runner exécute les builds → **ne pas le mettre sur erp** (sinon on retombe sur l'impact prod qu'on évite avec la CI). Un laptop avec Docker, un mini-VM, ou tout hôte Docker convient. Pour des builds occasionnels, un laptop allumé à la demande suffit. 1. Gitea : `Settings → Actions → Runners → Create new Runner` → copier le **registration token**. 2. Sur l'hôte du runner : ```bash docker run -d --restart=always --name targo-ci-runner \ -v /var/run/docker.sock:/var/run/docker.sock \ -e GITEA_INSTANCE_URL=https://git.targo.ca \ -e GITEA_RUNNER_REGISTRATION_TOKEN= \ -e GITEA_RUNNER_LABELS="ubuntu-latest:docker://catthehacker/ubuntu:act-22.04" \ gitea/act_runner:latest ``` 3. Le runner apparaît dans Gitea → **push** sur `apps/field-tech/**` (ou « Run workflow ») → l'APK debug sort dans **Artifacts** de l'exécution. ## 3. iOS (plus tard — compte Apple en attente) - iOS **ne build que sur macOS** : enregistrer un **Mac** comme runner (act_runner natif, label `macos`, Xcode installé). Pas d'image Docker possible. - Quand le compte Apple Developer est prêt : ajouter en **secrets dépôt** (`Settings → Actions → Secrets`) le certificat de distribution + provisioning profile (base64) + mot de passe ; le workflow iOS fera `xcodebuild -archive`/`-exportArchive` signé → TestFlight. ## 4. Secrets (selon besoin) | Secret | Pour | |---|---| | `TRANSISTORSOFT_LICENSE` | build **release** (debug = mode dev, sans licence) → injecté en meta-data AndroidManifest | | `ANDROID_KEYSTORE` (+ pass) | signer l'APK release | | `APPLE_CERT` / `APPLE_PROFILE` (+ pass) | signature iOS (device/TestFlight) | ## Alternative immédiate (sans runner) — build local Docker La même image existe en `apps/field-tech/Dockerfile` : `docker build -t targo-android-build . && docker run --rm -v "$PWD":/app -v targo-gradle:/root/.gradle targo-android-build` → APK. Voir `BUILD-ANDROID.md`.