[DTP-Worker 20260804_234104] Durcissement mobile-build.yml : gating d'activation via preflight-outputs (secrets-context hors if: job → risque SKIP silencieux) → 1 édition CI in-scope
- build-ios/build-android gataient sur `if: secrets.EAS_TOKEN != '' …` au niveau JOB, où le `secrets` context n'est pas garanti (GitHub Actions ne l'expose pas dans jobs.<id>.if ; act/Gitea = ambigu) → les builds pouvaient rester SKIP en silence le jour où Michel fournit un EAS_TOKEN valide. - Correctif = pattern canonique preflight-output : secret lu dans un step de preflight (secrets y est toujours dispo) → outputs booléens has_token/has_repo → gate consommé via needs.preflight.outputs.* (dispo en if: partout · portable GitHub ET Gitea/act). - Contrat observable inchangé (preflight vert + rapporte les secrets · builds SKIP sans token) → prose ci/README.md §Second workflow toujours exacte, 0 dérive doc. - Vérif : YAML valide · 0 secrets. restant dans un if: de job · needs:preflight conservé · 4 écritures $GITHUB_OUTPUT · aucun gate ne linte le workflow (hors gate.needs) · run_ci.sh 32 PASS inchangé. - 2 canaux de log à jour (activity_log + daily_reports addendum). 0 nouveau module (#5) · 0 chiffre inventé (#6) · aucune commande VPS (#8). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,19 +70,38 @@ jobs:
|
||||
preflight:
|
||||
name: Préflight config EAS + état secrets
|
||||
runs-on: ubuntu-latest
|
||||
# Le `secrets` context n'est PAS garanti disponible dans un `if:` au niveau
|
||||
# job (table d'availability GitHub Actions : `jobs.<id>.if` n'expose que
|
||||
# github/needs/vars/inputs/matrix + status functions, pas `secrets`). On lit
|
||||
# donc EAS_TOKEN ICI, dans un step (où `secrets` est toujours disponible),
|
||||
# et on l'expose en output booléen consommé par les jobs de build via
|
||||
# `needs.preflight.outputs.*` (lui, disponible en `if:` partout). Sinon les
|
||||
# builds risqueraient de rester SKIP en silence même une fois le token fourni.
|
||||
outputs:
|
||||
has_token: ${{ steps.secrets.outputs.has_token }}
|
||||
has_repo: ${{ steps.secrets.outputs.has_repo }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Config EAS versionnée présente (eas_build.json)
|
||||
run: test -f "$EAS_CONFIG" && echo "OK · profils build/submit versionnés dans $EAS_CONFIG"
|
||||
- name: État des secrets requis (aucun secret n'est loggé)
|
||||
id: secrets
|
||||
run: |
|
||||
echo "Profil sélectionné : $EAS_PROFILE"
|
||||
if [ -n "${{ secrets.EAS_TOKEN }}" ]; then
|
||||
echo "EAS_TOKEN : présent → les jobs de build vont s'exécuter."
|
||||
echo "has_token=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "EAS_TOKEN : ABSENT → jobs de build SKIP (attente Michel · expo.dev)."
|
||||
echo "has_token=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
if [ -n "${{ vars.MOBILE_NATIVE_REPO }}" ]; then
|
||||
echo "MOBILE_NATIVE_REPO: configuré."
|
||||
echo "has_repo=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "MOBILE_NATIVE_REPO: a_confirmer (dépôt Gitea du code natif Expo)."
|
||||
echo "has_repo=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
[ -n "${{ vars.MOBILE_NATIVE_REPO }}" ] && echo "MOBILE_NATIVE_REPO: configuré." || echo "MOBILE_NATIVE_REPO: a_confirmer (dépôt Gitea du code natif Expo)."
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Build iOS · SKIP tant que EAS_TOKEN absent (activation Michel · #6/#8).
|
||||
@@ -92,7 +111,7 @@ jobs:
|
||||
name: EAS build iOS (App Store #32)
|
||||
runs-on: ubuntu-latest
|
||||
needs: preflight
|
||||
if: ${{ secrets.EAS_TOKEN != '' && vars.MOBILE_NATIVE_REPO != '' && (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios' || github.event_name != 'workflow_dispatch') }}
|
||||
if: ${{ needs.preflight.outputs.has_token == 'true' && needs.preflight.outputs.has_repo == 'true' && (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios' || github.event_name != 'workflow_dispatch') }}
|
||||
env:
|
||||
EXPO_TOKEN: ${{ secrets.EAS_TOKEN }}
|
||||
steps:
|
||||
@@ -117,7 +136,7 @@ jobs:
|
||||
name: EAS build Android (Play Store)
|
||||
runs-on: ubuntu-latest
|
||||
needs: preflight
|
||||
if: ${{ secrets.EAS_TOKEN != '' && vars.MOBILE_NATIVE_REPO != '' && (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android' || github.event_name != 'workflow_dispatch') }}
|
||||
if: ${{ needs.preflight.outputs.has_token == 'true' && needs.preflight.outputs.has_repo == 'true' && (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android' || github.event_name != 'workflow_dispatch') }}
|
||||
env:
|
||||
EXPO_TOKEN: ${{ secrets.EAS_TOKEN }}
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user