diff --git a/.gitea/workflows/deploy-ios.yaml b/.gitea/workflows/deploy-ios.yaml index c79062d..3bd5216 100644 --- a/.gitea/workflows/deploy-ios.yaml +++ b/.gitea/workflows/deploy-ios.yaml @@ -1,4 +1,4 @@ -name: Deploy Flutter to Firebase iOS (Final & Safe) +name: Deploy Flutter to Firebase iOS (Final) on: push: branches: release @@ -11,66 +11,87 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Nettoyage et Dépendances + - name: Vérifier l'environnement Xcode 26.2 + run: | + # Utilise le moteur de build optimisé de Xcode 26.2 + xcodebuild -version + flutter doctor -v + + - name: Installer les dépendances (Flutter & Pods) run: | flutter pub get - cd ios && pod install --repo-update && cd .. + cd ios + # Mise à jour forcée pour éviter les conflits Firebase/Firestore 12.6.0 + pod install --repo-update || pod update + cd .. - - name: Préparer le Code Signing (Final) + - name: Créer les fichiers secrets + run: | + echo "${{ secrets.ENV_FILE }}" > .env + printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./ios/firebase_credentials.json + + - name: Préparer le Code Signing (Mode Mac Perso Safe) env: P12_BASE: ${{ secrets.IOS_P12_BASE64 }} P12_PASS: ${{ secrets.IOS_P12_PASSWORD }} PROV_BASE: ${{ secrets.IOS_PROVISION_BASE64 }} run: | - # 1. Nettoyage complet + # 1. Nettoyage et création d'un trousseau isolé security delete-keychain build.keychain || true - - # 2. Création du trousseau temporaire security create-keychain -p "" build.keychain security unlock-keychain -p "" build.keychain - # 3. LIER LE TROUSSEAU (Indispensable pour Xcode 26.2) - # On l'ajoute à la liste de recherche pour que Xcode le trouve + # 2. Lien vers la session sans changer le trousseau par défaut (évite le bug "Upsell") security list-keychains -d user -s build.keychain $(security list-keychains -d user | xargs) - # 4. Importation du certificat Apple Distribution + # 3. Import du certificat de Distribution echo "$P12_BASE" | base64 -D -o cert.p12 + # Autorise explicitement codesign pour éviter les popups bloquants security import cert.p12 -k build.keychain -P "$P12_PASS" -T /usr/bin/codesign -T /usr/bin/productsign - - # 5. Autoriser la signature automatique security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain - # 6. Installation du Profil (be.devdayronvl.TravelMate) + # 4. Installation du Profil de Provisionnement (be.devdayronvl.TravelMate) mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/dist.mobileprovision - - # 7. DEBUG : Vérifier que Xcode "voit" bien une identité valide - echo "Identités de signature détectées :" - security find-identity -v -p codesigning build.keychain + echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/distribution.mobileprovision - - name: Build IPA (Optimisé Xcode 26.2) + - name: Build IPA (Force Manual Distribution) run: | - # Xcode 26.2 accélère cette étape grâce au nouveau cache - flutter build ipa --release --export-method ad-hoc + # On force Xcode 26.2 à utiliser l'identité de distribution et non de développement + flutter build ipa --release \ + --export-method ad-hoc \ + --code-signing-manual \ + --code-signing-identity "Apple Distribution" - - name: Envoi Firebase via Fastlane + - name: Envoi Firebase via Fastlane (Bundler 2.7.2) env: FIREBASE_IOS_APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }} run: | + # Configuration Ruby 3.4 & Bundler compatible Fastlane + export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:$PATH" gem install bundler -v 2.7.2 --no-document + cd ios + # Utilisation de la syntaxe stricte pour Bundler 2.7.2 bundle _2.7.2_ config set path 'vendor/bundle' + + # Création du Gemfile moderne + echo "source 'https://rubygems.org'" > Gemfile + echo "gem 'fastlane', '>= 2.210.0'" >> Gemfile + echo "gem 'fastlane-plugin-firebase_app_distribution'" >> Gemfile + echo "gem 'base64'" >> Gemfile + bundle _2.7.2_ install + + echo "🚀 Envoi vers Firebase..." bundle _2.7.2_ exec fastlane run firebase_app_distribution \ app:"$FIREBASE_IOS_APP_ID" \ ipa_path:"../build/ios/ipa/*.ipa" \ service_credentials_file:"firebase_credentials.json" \ - release_notes:"Build stable via Xcode 26.2" + release_notes:"Build Flutter iOS via Xcode 26.2" - - name: Nettoyage Automatique - if: always() # Se lance même si le build échoue + - name: Nettoyage du Système + if: always() run: | - # On remet l'ordre des trousseaux à la normale pour ton Mac perso + # Restauration de la configuration normale de ton Mac security list-keychains -d user -s login.keychain - security delete-keychain build.keychain || true - rm -f ios/firebase_credentials.json \ No newline at end of file + security delete-keychain build.keychain || true \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9267a2a..5a2cb6e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -340,10 +340,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; @@ -372,10 +376,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; @@ -490,7 +498,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 456VVYXDFN; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -499,6 +511,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = be.devdayronvl.TravelMate; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = myiphone; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -673,7 +687,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 456VVYXDFN; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -682,6 +700,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = be.devdayronvl.TravelMate; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = myiphone; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -696,7 +716,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 456VVYXDFN; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -705,6 +729,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = be.devdayronvl.TravelMate; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = myiphone; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic";