From acfb2259ccaadbf116b5cb30dd4c201924be763e Mon Sep 17 00:00:00 2001 From: Van Leemput Dayron Date: Sun, 11 Jan 2026 00:12:56 +0100 Subject: [PATCH] test 31 --- .gitea/workflows/deploy.yaml | 89 ++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 50 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index ae7258a..228af48 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,31 +1,36 @@ -name: Deploy TravelMate (Full Mobile) +name: Deploy TravelMate Final Fix on: push: branches: - release jobs: - # --- JOB 1 : ANDROID (Génération APK) --- - deploy-android: + deploy-all: runs-on: macos-latest steps: - name: Checkout code uses: actions/checkout@v3 - - name: Configuration Flutter & Secrets + - name: 1. Setup Environnement & Assets run: | flutter pub get + # On crée le .env à la racine ET dans ios/ pour être sûr que Flutter le voit echo "${{ secrets.ENV_FILE }}" > .env + cp .env ios/.env + + # Vérification immédiate + if [ ! -s .env ]; then echo "ERREUR: Le secret ENV_FILE est vide !"; exit 1; fi + + printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./ios/firebase_credentials.json printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./android/firebase_credentials.json - - name: Build & Deploy Android + - name: 2. Build Android (APK) working-directory: ./android env: ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} RAW_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }} FIREBASE_ANDROID_APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }} run: | - # 1. Keystore echo "$ANDROID_KEYSTORE_BASE64" | base64 -D > keystore.jks echo "$RAW_PROPERTIES" > temp_props.txt echo "storePassword=$(grep 'storePassword' temp_props.txt | cut -d'=' -f2 | tr -d '\r')" > key.properties @@ -33,37 +38,19 @@ jobs: echo "keyAlias=$(grep 'keyAlias' temp_props.txt | cut -d'=' -f2 | tr -d '\r')" >> key.properties echo "storeFile=$(pwd)/keystore.jks" >> key.properties - # 2. Gemfile (Correctifs Ruby 3.4 inclus) - echo "source 'https://rubygems.org'" > Gemfile - echo "gem 'fastlane', '>= 2.230.0'" >> Gemfile - echo "gem 'fastlane-plugin-firebase_app_distribution'" >> Gemfile - for g in abbrev ostruct mutex_m base64 csv bigdecimal drb nkf reline logger; do echo "gem '$g'" >> Gemfile; done - - gem install bundler -v 2.7.2 --no-document - bundle _2.7.2_ update - - # 3. Build & Envoi cd .. && flutter build apk --release && cd android - bundle _2.7.2_ exec fastlane run firebase_app_distribution \ + + # Ruby Patches pour Ruby 3.4 + echo "source 'https://rubygems.org'\ngem 'fastlane'\ngem 'fastlane-plugin-firebase_app_distribution'" > Gemfile + for g in abbrev ostruct mutex_m base64 csv bigdecimal drb nkf reline logger; do echo "gem '$g'" >> Gemfile; done + bundle install --path vendor/bundle + + bundle exec fastlane run firebase_app_distribution \ app:"$FIREBASE_ANDROID_APP_ID" \ android_artifact_path:"../build/app/outputs/flutter-apk/app-release.apk" \ service_credentials_file:"firebase_credentials.json" - # --- JOB 2 : IOS (Génération IPA) --- - deploy-ios: - runs-on: macos-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Dépendances iOS & Secrets - run: | - flutter pub get - echo "${{ secrets.ENV_FILE }}" > .env - printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./ios/firebase_credentials.json - cd ios && (pod install --repo-update || pod update) - - - name: Préparer le Code Signing (Xcode 26.2) + - name: 3. Préparer iOS (Signing) env: P12_BASE: ${{ secrets.IOS_P12_BASE64 }} P12_PASS: ${{ secrets.IOS_P12_PASSWORD }} @@ -78,38 +65,40 @@ jobs: security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/distribution.mobileprovision + cd ios && pod install --repo-update - - name: Build IPA + - name: 4. Build IPA (iOS) run: | flutter clean flutter pub get + # On force le build en Ad-Hoc flutter build ipa --release --export-method ad-hoc - - name: Envoi Firebase iOS + - name: 5. Debug & Envoi Firebase iOS env: FIREBASE_IOS_APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }} run: | cd ios - # Utilisation du Gemfile stabilisé - echo "source 'https://rubygems.org'" > Gemfile - echo "gem 'fastlane', '>= 2.230.0'" >> Gemfile - echo "gem 'fastlane-plugin-firebase_app_distribution'" >> Gemfile + echo "source 'https://rubygems.org'\ngem 'fastlane'\ngem 'fastlane-plugin-firebase_app_distribution'" > Gemfile for g in abbrev ostruct mutex_m base64 csv bigdecimal drb nkf reline logger; do echo "gem '$g'" >> Gemfile; done + bundle install --path vendor/bundle - gem install bundler -v 2.7.2 --no-document - bundle _2.7.2_ update + # ON CHERCHE L'IPA PARTOUT ET ON LISTE TOUT SI PAS TROUVÉ + echo "🔍 Recherche de l'IPA..." + IPA_PATH=$(find .. -name "*.ipa" | head -n 1) - # RECHERCHE DYNAMIQUE DE L'IPA - IPA_FILE=$(find ../build/ios/ipa -name "*.ipa" | head -n 1) - echo "📦 IPA trouvée : $IPA_FILE" - - bundle _2.7.2_ exec fastlane run firebase_app_distribution \ + if [ -z "$IPA_PATH" ]; then + echo "❌ IPA NON GÉNÉRÉE. Listing du dossier build pour comprendre :" + ls -R ../build + exit 1 + fi + + echo "📦 IPA trouvée : $IPA_PATH" + bundle exec fastlane run firebase_app_distribution \ app:"$FIREBASE_IOS_APP_ID" \ - ipa_path:"$IPA_FILE" \ + ipa_path:"$IPA_PATH" \ service_credentials_file:"firebase_credentials.json" - - name: Nettoyage Final + - name: 6. Nettoyage if: always() - run: | - security list-keychains -d user -s login.keychain - security delete-keychain build.keychain || true \ No newline at end of file + run: security delete-keychain build.keychain || true \ No newline at end of file