Compare commits
6 Commits
fix/ci-pr-
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a1a70af87 | ||
| e2532a8136 | |||
|
|
27f9c6b7b6 | ||
|
|
98f4f82db2 | ||
|
|
1ada238004 | ||
| 6937a36ccd |
211
.github/workflows/pr-iphone-deploy.yml
vendored
211
.github/workflows/pr-iphone-deploy.yml
vendored
@@ -1,24 +1,55 @@
|
||||
# =============================================================================
|
||||
# TabataGo — PR → Build → WiFi/USB Direct Deploy → Wait LGTM → Merge
|
||||
# TabataGo — PR → Build → devicectl Deploy → Wait LGTM → Merge
|
||||
# =============================================================================
|
||||
|
||||
name: PR → Build → WiFi/USB Deploy → LGTM
|
||||
name: PR → Build → devicectl Deploy → LGTM
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
types: [opened, synchronize, reopened]
|
||||
# NOTE: no trigger-level `paths:` here — Gitea Actions does not reliably
|
||||
# honor `on.pull_request.paths:` filters (the workflow silently fails to
|
||||
# trigger even when changed files match). Path gating is done at the job
|
||||
# level via dorny/paths-filter@v3 in the `changes` job below (same pattern
|
||||
# as ci.yml). Docs/backend-only PRs then skip the macOS runner.
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
# Every mutation (comments, merge) goes through the Gitea API with PR_API_TOKEN,
|
||||
# never the runner's native GITHUB_TOKEN — so a `permissions:` block would be
|
||||
# a no-op here. Intentionally omitted.
|
||||
concurrency:
|
||||
# Per-PR grouping: superseded pushes cancel the previous pipeline, different
|
||||
# PRs still run in parallel. Prevents double-merges and wasted runner time.
|
||||
group: pr-iphone-deploy-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
# ── Path filter — determines whether the macOS build+deploy is worth running ──
|
||||
# Gitea Actions does not honor trigger-level `on.pull_request.paths:`, so we
|
||||
# gate at the job level with dorny/paths-filter (same pattern as ci.yml).
|
||||
changes:
|
||||
name: Detect Changes
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
ios: ${{ steps.filter.outputs.ios }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
ios:
|
||||
- 'tabatago-swift/**'
|
||||
- '.github/workflows/pr-iphone-deploy.yml'
|
||||
|
||||
build-deploy:
|
||||
name: Build & Deploy to iPhone (WiFi/USB)
|
||||
name: Build & Deploy to iPhone (devicectl)
|
||||
needs: changes
|
||||
if: needs.changes.outputs.ios == 'true'
|
||||
runs-on: macos
|
||||
timeout-minutes: 20
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -42,9 +73,11 @@ jobs:
|
||||
# Act runner caches
|
||||
rm -rf ~/.cache/act/*/hostexecutor/tabatago-swift/build 2>/dev/null || true
|
||||
|
||||
# SPM caches are KEPT between runs — RevenueCat is 1.10 GiB and takes
|
||||
# SPM cache is KEPT between runs — RevenueCat is ~1.10 GiB and takes
|
||||
# 5+ minutes to clone; re-cloning on every CI run would waste time
|
||||
# and cause random failures on the act_runner sandbox.
|
||||
# and cause random failures on the act_runner sandbox. It lives at
|
||||
# build/spm-cache (see -clonedSourcePackagesDirPath in the Build step)
|
||||
# so NEVER `rm -rf build/` — only delete build/derived.
|
||||
|
||||
# Xcode DerivedData — suppression COMPLÈTE (le bundle ID a changé,
|
||||
# l'ancien dossier TabataGo-* peut être ignoré par le nouveau build)
|
||||
@@ -52,10 +85,12 @@ jobs:
|
||||
|
||||
# Module cache Xcode — des .pcm stale peuvent segfault le linker
|
||||
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex 2>/dev/null || true
|
||||
rm -rf ~/Library/Caches/com.apple.dt.Xcode
|
||||
# NOTE: do NOT `rm -rf ~/Library/Caches/com.apple.dt.Xcode` — that is the
|
||||
# shared global cache; wiping it slows every subsequent build.
|
||||
|
||||
# Build artifacts locaux (utilisés par le step "Build app")
|
||||
rm -rf build/
|
||||
# Build artifacts locaux — sparing build/spm-cache (see above).
|
||||
rm -rf build/derived
|
||||
rm -rf build/*.log 2>/dev/null || true
|
||||
rm -rf .build
|
||||
rm -rf tabatago-swift/.build
|
||||
rm -rf tabatago-swift/TabataGo.xcodeproj
|
||||
@@ -65,11 +100,45 @@ jobs:
|
||||
find . -name "Package.resolved" -delete 2>/dev/null || true
|
||||
find . -name ".package.resolved" -delete 2>/dev/null || true
|
||||
|
||||
echo "✅ Caches nettoyés"
|
||||
echo "✅ Caches nettoyés (SPM cache préservé)"
|
||||
|
||||
- name: Install tools (xcodegen, node, ios-deploy)
|
||||
- name: Install tools (xcodegen)
|
||||
run: |
|
||||
brew install xcodegen node ios-deploy || true
|
||||
# The act_runner shell can land under Rosetta 2 on Apple Silicon;
|
||||
# Homebrew lives in /opt/homebrew (ARM prefix), so run brew natively.
|
||||
# (Brew refuses to install/upgrade under Rosetta in the ARM prefix.)
|
||||
# Only xcodegen is needed — node is NOT used by any step in this
|
||||
# workflow, and installing it triggers brew's "installed dependents
|
||||
# check" which tries to rebuild unrelated formulae (e.g. gemini-cli)
|
||||
# and fails the build.
|
||||
arch -arm64 brew install xcodegen
|
||||
|
||||
- name: Write Secrets.xcconfig from Gitea secrets
|
||||
env:
|
||||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
|
||||
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
|
||||
REVENUECAT_API_KEY: ${{ secrets.REVENUECAT_API_KEY }}
|
||||
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
|
||||
run: |
|
||||
# Preflight: fail loudly if a secret is missing, rather than producing
|
||||
# an .app that silently can't reach Supabase/RevenueCat at runtime.
|
||||
for v in SUPABASE_URL SUPABASE_ANON_KEY REVENUECAT_API_KEY; do
|
||||
val="$(printenv "$v")"
|
||||
if [ -z "$val" ]; then
|
||||
echo "❌ Secret missing: $v. Add it to Gitea repo secrets."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
# POSTHOG_API_KEY may legitimately be empty (PostHog not yet wired).
|
||||
# NOTE: heredoc body MUST start at column 0 — xcconfig keys are
|
||||
# whitespace-sensitive, leading spaces would break the build setting.
|
||||
cat > tabatago-swift/Config/Secrets.xcconfig <<EOF
|
||||
SUPABASE_URL = ${SUPABASE_URL}
|
||||
SUPABASE_ANON_KEY = ${SUPABASE_ANON_KEY}
|
||||
REVENUECAT_API_KEY = ${REVENUECAT_API_KEY}
|
||||
POSTHOG_API_KEY = ${POSTHOG_API_KEY}
|
||||
EOF
|
||||
echo "✅ Secrets.xcconfig written (values redacted)"
|
||||
|
||||
- name: Generate Xcode project
|
||||
run: |
|
||||
@@ -99,27 +168,20 @@ jobs:
|
||||
CODE_SIGN_STYLE=Automatic \
|
||||
DEVELOPMENT_TEAM=2MJF39L8VY
|
||||
|
||||
- name: Install to iPhone (WiFi → USB fallback)
|
||||
- name: Install to iPhone (devicectl)
|
||||
run: |
|
||||
UDID="00008120-000925CE3672201E"
|
||||
APP=$(find build/derived -name 'TabataGo.app' -type d | head -1)
|
||||
|
||||
# 1. Try WiFi first (Xcode 15+ devicectl network discovery)
|
||||
echo "📱 Trying WiFi install via devicectl..."
|
||||
if xcrun devicectl device install app --device "$UDID" "$APP" > /tmp/devicectl.log 2>&1; then
|
||||
echo "✅ Installed via WiFi"
|
||||
exit 0
|
||||
fi
|
||||
tail -10 /tmp/devicectl.log
|
||||
|
||||
# 2. Fallback to USB via ios-deploy
|
||||
echo "🔌 WiFi failed, trying USB..."
|
||||
if ios-deploy --bundle "$APP" --id "$UDID" --justlaunch; then
|
||||
echo "✅ Installed via USB"
|
||||
# devicectl handles both WiFi (network) and wired (USB-C/Thunderbolt)
|
||||
# discovery natively — no separate USB-fallback tool needed.
|
||||
echo "📱 Installing via devicectl..."
|
||||
if xcrun devicectl device install app --device "$UDID" "$APP"; then
|
||||
echo "✅ Installed via devicectl"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "❌ Install failed (both WiFi and USB)"
|
||||
echo "❌ devicectl install failed"
|
||||
exit 1
|
||||
|
||||
|
||||
@@ -130,15 +192,25 @@ jobs:
|
||||
run: |
|
||||
PR="${{ github.event.pull_request.number }}"
|
||||
REPO="${{ github.repository }}"
|
||||
# The HTML comment is invisible in Gitea's rendered markdown but is
|
||||
# present in the raw body — wait-approval uses it as a sentinel to
|
||||
# skip THIS bot comment when scanning for LGTM/KO (otherwise the
|
||||
# instruction text "Reply LGTM pour merger" would self-trigger a
|
||||
# merge ~30s after deploy). DO NOT remove or reword without also
|
||||
# updating the scanner in the wait-approval job.
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GT_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\":\"## 📱 Prêt à tester !\\n\\nL'app est déployée sur l'iPhone (USB/WiFi).\\n\\n- Teste les changements\\n- Reply **LGTM** pour merger\\n- Reply **KO** pour bloquer\"}" \
|
||||
-d "{\"body\":\"## 📱 Prêt à tester !\\n\\nL'app est déployée sur l'iPhone (devicectl).\\n\\n<!-- tabatago:ready-to-test -->\\n\\n- Teste les changements\\n- Reply **LGTM** pour merger\\n- Reply **KO** pour bloquer\"}" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO}/issues/${PR}/comments"
|
||||
|
||||
wait-approval:
|
||||
name: Wait for LGTM comment
|
||||
needs: build-deploy
|
||||
# Only run when build-deploy actually deployed. Without this, a skipped
|
||||
# build-deploy (filtered out by `changes`) would still launch this job and
|
||||
# the merge poll would run against a PR that was never deployed to device.
|
||||
if: needs.build-deploy.result == 'success'
|
||||
runs-on: macos
|
||||
timeout-minutes: 120
|
||||
|
||||
@@ -157,32 +229,75 @@ jobs:
|
||||
|
||||
echo "⏳ Attente LGTM sur PR #${PR}..."
|
||||
|
||||
LAST_ID=$(curl -s -H "Authorization: token ${GT_TOKEN}" \
|
||||
"${API}/issues/${PR}/comments" | \
|
||||
python3 -c "import json,sys; cs=json.load(sys.stdin); print(cs[-1]['id'] if cs else 0)" 2>/dev/null || echo 0)
|
||||
# Re-fetch ALL comments each cycle (not since_id) so we also catch
|
||||
# edits — e.g. a reviewer changing "KO" → "LGTM". Negligible cost for
|
||||
# PRs with <50 comments.
|
||||
#
|
||||
# Parsing is done with python3 (preinstalled on the macOS runner and
|
||||
# already used by scripts/ci-status.py) rather than grep over raw JSON:
|
||||
# - the bot's "Ready to test" comment body literally contains the
|
||||
# words LGTM/KO as instructions to the reviewer, so any naive
|
||||
# body grep would self-match and auto-merge ~30s after deploy.
|
||||
# We skip it via the <!-- tabatago:ready-to-test --> sentinel
|
||||
# embedded by the build-deploy job;
|
||||
# - json.loads avoids false matches when the literal "body" key or
|
||||
# trigger words appear inside another string field.
|
||||
# KO is checked BEFORE LGTM so a PR with both signals blocks (matches
|
||||
# the existing "KO blocks" intent — a reviewer who flip-flops shouldn't
|
||||
# merge just because an older LGTM is still in the history).
|
||||
|
||||
while [ $TRIES -lt $MAX ]; do
|
||||
sleep 30
|
||||
TRIES=$((TRIES + 1))
|
||||
|
||||
COMMENTS=$(curl -s -H "Authorization: token ${GT_TOKEN}" \
|
||||
"${API}/issues/${PR}/comments?since_id=${LAST_ID}")
|
||||
"${API}/issues/${PR}/comments?limit=50&page=1")
|
||||
|
||||
if echo "$COMMENTS" | grep -qi '"body": *"LGTM"'; then
|
||||
echo "✅ LGTM reçu ! Merge..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GT_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"Do\":\"merge\"}" \
|
||||
"${API}/pulls/${PR}/merge"
|
||||
echo "✅ Mergée."
|
||||
exit 0
|
||||
fi
|
||||
DECISION=$(python3 - "$COMMENTS" <<'PY'
|
||||
import json, re, sys
|
||||
MARKER = "<!-- tabatago:ready-to-test -->"
|
||||
try:
|
||||
comments = json.loads(sys.argv[1] or "[]")
|
||||
except Exception:
|
||||
comments = []
|
||||
lgtm = re.compile(r"\bLGTM\b", re.IGNORECASE)
|
||||
ko = re.compile(r"\bKO\b", re.IGNORECASE)
|
||||
hit_lgtm = hit_ko = False
|
||||
for c in comments:
|
||||
body = c.get("body") or ""
|
||||
if MARKER in body:
|
||||
# Skip the bot's own "Ready to test" comment — its body mentions
|
||||
# LGTM/KO as instructions and would otherwise self-trigger.
|
||||
continue
|
||||
if ko.search(body):
|
||||
hit_ko = True
|
||||
if lgtm.search(body):
|
||||
hit_lgtm = True
|
||||
if hit_ko:
|
||||
print("KO")
|
||||
elif hit_lgtm:
|
||||
print("LGTM")
|
||||
else:
|
||||
print("PENDING")
|
||||
PY
|
||||
)
|
||||
|
||||
if echo "$COMMENTS" | grep -qi '"body": *"KO"'; then
|
||||
echo "❌ KO reçu. Bloquée."
|
||||
exit 1
|
||||
fi
|
||||
case "$DECISION" in
|
||||
LGTM)
|
||||
echo "✅ LGTM reçu ! Squash-merge..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GT_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"Do\":\"squash\"}" \
|
||||
"${API}/pulls/${PR}/merge"
|
||||
echo "✅ Mergée (squash)."
|
||||
exit 0
|
||||
;;
|
||||
KO)
|
||||
echo "❌ KO reçu. Bloquée."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $((TRIES % 4)) -eq 0 ]; then
|
||||
echo " ⏳ ... (${TRIES}/240, $(date +%H:%M))"
|
||||
|
||||
47
AGENTS.md
47
AGENTS.md
@@ -152,34 +152,44 @@ Complications : `TabataGoComplication`.
|
||||
### Workflow : `.github/workflows/pr-iphone-deploy.yml`
|
||||
|
||||
**Trigger** : PR ouverte/synchronize/reopened sur `main`.
|
||||
**Runner** : label `macos` (auto-hébergé).
|
||||
**Runner** : label `macos` (auto-hébergé). `timeout-minutes: 30` (build-deploy), `120` (wait-approval).
|
||||
**Concurrency** : `group: pr-iphone-deploy-<PR#>`, `cancel-in-progress: true` → un push sur une PR existante annule le pipeline précédent (pas de double-merge, pas de runner gaspillé). Différentes PRs tournent en parallèle.
|
||||
**Déroulé** :
|
||||
|
||||
1. **Checkout** (shallow, branche head) via `PR_API_TOKEN`.
|
||||
2. **Setup PATH** : `echo "/opt/homebrew/bin" >> $GITHUB_PATH` — requis car Rosetta ne le voit pas.
|
||||
3. **Clean ciblé** :
|
||||
- Supprime build artifacts, `TabataGo.xcodeproj`, `Package.resolved`, DerivedData, ModuleCache.
|
||||
- **GARDE le cache SPM** (`../build/spm-cache`) — RevenueCat ≈ 1.1 GiB, re-cloner = 5+ min et échecs aléatoires du sandbox.
|
||||
4. **Install tools** : `brew install xcodegen node ios-deploy`.
|
||||
5. **xcodegen generate** → `xcodebuild -resolvePackageDependencies` → **build** (`-scheme TabataGo`, Debug, auto-provisioning, team `2MJF39L8VY`).
|
||||
6. **Deploy iPhone** UDID `00008120-000925CE3672201E` : `devicectl` WiFi d'abord, fallback `ios-deploy` USB.
|
||||
7. **Post comment** "Prêt à tester" sur la PR.
|
||||
8. **Job `wait-approval`** : poll (30s, max 240 = 2h) les commentaires de la PR. `LGTM` → auto-merge. `KO` → blocage. Timeout → fail.
|
||||
- Supprime `build/derived`, `TabataGo.xcodeproj`, `Package.resolved`, DerivedData, ModuleCache.
|
||||
- **GARDE le cache SPM** (`build/spm-cache` — c'est le chemin passé à `-clonedSourcePackagesDirPath`) — RevenueCat ≈ 1.1 GiB, re-cloner = 5+ min et échecs aléatoires du sandbox. **Ne jamais faire `rm -rf build/`** : ça détruirait ce cache. Le clean step ne touche que `build/derived`.
|
||||
- Ne touche **pas** à `~/Library/Caches/com.apple.dt.Xcode` (cache Xcode global — le nuke ralentit tous les builds suivants).
|
||||
4. **Install tools** : `arch -arm64 brew install xcodegen` (sans `|| true` — si brew down, on fail ici, pas deux steps plus loin). `arch -arm64` requis car le shell act_runner tourne sous Rosetta 2 sur Apple Silicon, mais Homebrew est dans le prefix ARM `/opt/homebrew` — sans ça, brew refuse d'installer/upgrader. Seul xcodegen est nécessaire : **node n'est pas utilisé** par ce workflow, et l'installer déclenche le "installed dependents check" de brew qui essaie de rebuilder des formulae sans rapport (ex. `gemini-cli`) et fail le build.
|
||||
5. **Write `Config/Secrets.xcconfig`** depuis les secrets Gitea (`SUPABASE_URL`, `SUPABASE_ANON_KEY`, `REVENUECAT_API_KEY`, `POSTHOG_API_KEY`). Preflight : fail loud si un secret requis manque. Le fichier est gitigné (règle #9) ; CI l'écrase à chaque run. `Info.plist` lit les valeurs via `$(SUPABASE_URL)` etc., et `project.yml` wire le xcconfig en Debug+Release — aucun autre changement nécessaire côté build.
|
||||
6. **xcodegen generate** → `xcodebuild -resolvePackageDependencies` → **build** (`-scheme TabataGo`, Debug, auto-provisioning, team `2MJF39L8VY`). Le scheme build les 4 targets : `TabataGo` (app iOS), `TabataGoWidget` (widget iOS, vrai target — ne pas confondre avec `TabataGoWatchWidget` qui est watchOS), `TabataGoWatch` (app watchOS), `TabataGoWatchWidget` (complication watchOS).
|
||||
7. **Deploy iPhone** UDID `00008120-000925CE3672201E` : `xcrun devicectl device install app` uniquement. `devicectl` gère nativement la découverte WiFi (réseau) et filaire (USB-C/Thunderbolt) — pas de fallback `ios-deploy`.
|
||||
8. **Post comment** "Prêt à tester" sur la PR.
|
||||
9. **Job `wait-approval`** : poll (30s, max 240 = 2h). **Re-fetche TOUS les comments** chaque cycle (pas `since_id`) pour attraper aussi les edits (un reviewer passant de "KO" à "LGTM"). Le parsing se fait en **python3** (`json.loads` + regex, pas de `grep` sur JSON brut). **Le commentaire bot "Prêt à tester" porte un marker sentinel `<!-- tabatago:ready-to-test -->`** et est **ignoré** par le scanner — sinon son propre body (qui mentionne LGTM/KO comme instructions au reviewer) déclencherait un auto-merge ~30s après le deploy (bug historique). KO est checké **avant** LGTM (un PR avec les deux signaux bloque). Match LGTM/KO n'importe où dans le body (regex `\bLGTM\b` / `\bKO\b`, case-insensitive) — "Tested, LGTM!" compte ; "KOM" ne compte pas. `LGTM` → **squash-merge** (`{"Do":"squash"}`). `KO` → blocage. Timeout → fail.
|
||||
|
||||
### Secrets
|
||||
|
||||
| Secret | Usage |
|
||||
|--------|-------|
|
||||
| `PR_API_TOKEN` | Checkout + API Gitea (comment, merge). **JAMAIS `GITEA_TOKEN`/`GITHUB_TOKEN`** |
|
||||
| `SUPABASE_URL`, `SUPABASE_ANON_KEY`, `REVENUECAT_API_KEY`, `POSTHOG_API_KEY` | Injectés via `Config/Secrets.xcconfig` → Info.plist |
|
||||
| `PR_API_TOKEN` | Checkout + API Gitea (comment, merge). **JAMAIS `GITEA_TOKEN`/`GITHUB_TOKEN`**. Tout passe par l'API Gitea avec ce token — un bloc `permissions:` natif serait no-op, c'est pourquoi il n'y en a pas. |
|
||||
| `SUPABASE_URL`, `SUPABASE_ANON_KEY`, `REVENUECAT_API_KEY`, `POSTHOG_API_KEY` | Un step CI écrit `Config/Secrets.xcconfig` depuis ces 4 secrets **avant** `xcodegen generate`. `Info.plist` lit les valeurs via `$(SUPABASE_URL)` etc. ; `project.yml` wire le xcconfig en Debug+Release. `POSTHOG_API_KEY` peut être vide (PostHog pas encore câblé en SPM). |
|
||||
|
||||
> ⚠️ **Historique** : `Config/Secrets.xcconfig` a été committé par erreur dans le passé (avant la règle gitignore) avec des valeurs réelles. Le fichier est maintenant gitigné et écrasé par CI, mais l'historique git contient encore l'ancienne version — **rotation des clés Supabase/RevenueCat recommandée côté ops**.
|
||||
|
||||
### ⚠️ Pitfalls CI
|
||||
|
||||
- `/opt/homebrew/bin` **hors PATH par défaut** sous Rosetta → toujours l'ajouter.
|
||||
- **xcodegen 2.45.4 ne génère pas de schemes auto** → scheme `TabataGo` défini explicitement dans `project.yml` (ne pas le supprimer).
|
||||
- **Ne jamais `rm -rf` le cache SPM** dans le CI (c'est l'inverse des build artifacts).
|
||||
- **xcodegen 2.45.4 ne génère pas de schemes auto** → scheme `TabataGo` défini explicitement dans `project.yml` (ne pas le supprimer). Il liste **4 targets** : `TabataGo`, `TabataGoWidget`, `TabataGoWatch`, `TabataGoWatchWidget`.
|
||||
- **Ne jamais `rm -rf build/` ni `rm -rf build/spm-cache`** dans le CI — RevenueCat y vit. Le clean step ne touche que `build/derived`.
|
||||
- `SWIFT_ENABLE_EXPLICIT_MODULES=NO` au build — requis sinon segfault linker sur `.pcm` stale.
|
||||
- `-skipPackagePluginValidation -allowProvisioningUpdates`.
|
||||
- **Concurrency** : le bloc `concurrency:` est volontaire — ne pas le retirer, sinon les pushes successifs empilent des pipelines et tentent des double-merges.
|
||||
- **LGTM/KO regex** : matche n'importe où dans le body avec `\b...\b` (word boundary). Ne pas revenir à un `grep '"body": *"LGTM"'` ancré — il raterait "Tested, LGTM!".
|
||||
- **Self-match sentinel** : le commentaire bot "Prêt à tester" contient littéralement `Reply **LGTM** pour merger` et `Reply **KO**` — sans précaution, le scanner matche son **propre** commentaire et auto-merge ~30s après le deploy. Le body porte donc un marker `<!-- tabatago:ready-to-test -->` que `wait-approval` ignore. **Tout commentaire bot posté par ce workflow doit porter ce marker** ; ne pas le retirer ni poster d'autre commentaire contenant LGTM/KO sans marker.
|
||||
- **Squash-merge** (`{"Do":"squash"}`) — pas merge commit ni rebase. Garde l'historique `main` linéaire.
|
||||
- **Comment edits** : `wait-approval` re-fetche tous les comments chaque cycle (pas `since_id`) pour attraper les edits.
|
||||
|
||||
---
|
||||
|
||||
@@ -219,7 +229,7 @@ Node.js (`server.js`, `package.json`, `Dockerfile`). Télécharge l'audio de pla
|
||||
6. **Navigation = TabView + sheet/fullScreenCover.** **Pas de `NavigationStack`.**
|
||||
7. **Tout en français** côté user-facing (`Localizable.xcstrings` / `L10n`). Codes/types restent en anglais.
|
||||
8. **XcodeGen.** Éditer `project.yml`, pas `.xcodeproj`. Régénérer avec `xcodegen generate`.
|
||||
9. **Secrets.** Jamais committer `Config/Secrets.xcconfig`. Template = `.example`.
|
||||
9. **Secrets.** Jamais committer `Config/Secrets.xcconfig`. Template = `.example`. En CI, un step écrit ce fichier depuis les secrets Gitea (`SUPABASE_URL`, `SUPABASE_ANON_KEY`, `REVENUECAT_API_KEY`, `POSTHOG_API_KEY`) **avant** `xcodegen generate` ; `Info.plist` lit les valeurs via `$(VAR)` et `project.yml` wire le xcconfig en Debug+Release.
|
||||
10. **Lazy d'abord.** Avant d'ajouter une dépendance : stdlib Apple, puis ce qui existe déjà dans le repo, puis SPM déjà installé. PostHog n'est pas installé — ne pas l'ajouter sans justification.
|
||||
|
||||
---
|
||||
@@ -234,9 +244,16 @@ Node.js (`server.js`, `package.json`, `Dockerfile`). Télécharge l'audio de pla
|
||||
| `@ObservableObject` / `@Published` | `@Observable` |
|
||||
| Force-unwrap `!` | `guard let` |
|
||||
| Strings UI en anglais | Françaises dans `L10n`/`Localizable.xcstrings` |
|
||||
| `rm -rf` le cache SPM en CI | Garder `build/spm-cache` |
|
||||
| `rm -rf build/` ou `rm -rf build/spm-cache` en CI | Garder `build/spm-cache` ; ne cleaner que `build/derived` |
|
||||
| `rm -rf ~/Library/Caches/com.apple.dt.Xcode` | Laisser le cache Xcode global intact (sinon tous les builds ralentissent) |
|
||||
| Utiliser `GITEA_TOKEN` en CI | `PR_API_TOKEN` uniquement |
|
||||
| Supprimer le scheme explicite dans `project.yml` | xcodegen 2.45.4 n'en crée pas |
|
||||
| Compter sur un bloc `permissions:` natif Gitea Actions | Tout passe par l'API Gitea avec `PR_API_TOKEN` ; le bloc natif serait no-op |
|
||||
| Retirer le bloc `concurrency:` | Permet double-merge et pipelines empilés |
|
||||
| Ancre le grep LGTM au début du body (`'"body": *"LGTM"'`) | Regex `\bLGTM\b` n'importe où dans le body (attrape "Tested, LGTM!") |
|
||||
| Poster un commentaire bot dont le body contient "LGTM"/"KO" sans le marker `<!-- tabatago:ready-to-test -->` | Le scanner bot-scan ignore les comments portant le marker — tout commentaire bot du workflow doit l'inclure (sinon auto-merge en ~30s) |
|
||||
| Scanner les comments en `grep` sur le JSON brut | `python3` + `json.loads` (gère unicode/quotes, pas de false match sur la clé `"body"`) |
|
||||
| `{"Do":"merge"}` (merge commit) | `{"Do":"squash"}` pour un `main` linéaire |
|
||||
| Supprimer le scheme explicite dans `project.yml` | xcodegen 2.45.4 n'en crée pas — scheme doit lister `TabataGo`/`TabataGoWidget`/`TabataGoWatch`/`TabataGoWatchWidget` |
|
||||
| Compter sur `admin-web/` pour la app iOS | Dashboard admin séparé, communique via Supabase uniquement |
|
||||
| Recréer `programs`/`program_workouts` | Remplacés par `workout_programs`/`program_tabatas` (migration 005) |
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "my-app",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -216,6 +216,8 @@ schemes:
|
||||
targets:
|
||||
TabataGo: all
|
||||
TabataGoWidget: all
|
||||
TabataGoWatch: all
|
||||
TabataGoWatchWidget: all
|
||||
run:
|
||||
config: Debug
|
||||
archive:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user