test 31
Some checks failed
Deploy TravelMate Final Fix / deploy-all (push) Failing after 1m12s

This commit is contained in:
Van Leemput Dayron
2026-01-11 00:12:56 +01:00
parent d1d2194861
commit acfb2259cc

View File

@@ -1,31 +1,36 @@
name: Deploy TravelMate (Full Mobile) name: Deploy TravelMate Final Fix
on: on:
push: push:
branches: branches:
- release - release
jobs: jobs:
# --- JOB 1 : ANDROID (Génération APK) --- deploy-all:
deploy-android:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Configuration Flutter & Secrets - name: 1. Setup Environnement & Assets
run: | run: |
flutter pub get 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 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 printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./android/firebase_credentials.json
- name: Build & Deploy Android - name: 2. Build Android (APK)
working-directory: ./android working-directory: ./android
env: env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
RAW_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }} RAW_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }}
FIREBASE_ANDROID_APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }} FIREBASE_ANDROID_APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }}
run: | run: |
# 1. Keystore
echo "$ANDROID_KEYSTORE_BASE64" | base64 -D > keystore.jks echo "$ANDROID_KEYSTORE_BASE64" | base64 -D > keystore.jks
echo "$RAW_PROPERTIES" > temp_props.txt echo "$RAW_PROPERTIES" > temp_props.txt
echo "storePassword=$(grep 'storePassword' temp_props.txt | cut -d'=' -f2 | tr -d '\r')" > key.properties 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 "keyAlias=$(grep 'keyAlias' temp_props.txt | cut -d'=' -f2 | tr -d '\r')" >> key.properties
echo "storeFile=$(pwd)/keystore.jks" >> 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 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" \ app:"$FIREBASE_ANDROID_APP_ID" \
android_artifact_path:"../build/app/outputs/flutter-apk/app-release.apk" \ android_artifact_path:"../build/app/outputs/flutter-apk/app-release.apk" \
service_credentials_file:"firebase_credentials.json" service_credentials_file:"firebase_credentials.json"
# --- JOB 2 : IOS (Génération IPA) --- - name: 3. Préparer iOS (Signing)
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)
env: env:
P12_BASE: ${{ secrets.IOS_P12_BASE64 }} P12_BASE: ${{ secrets.IOS_P12_BASE64 }}
P12_PASS: ${{ secrets.IOS_P12_PASSWORD }} P12_PASS: ${{ secrets.IOS_P12_PASSWORD }}
@@ -78,38 +65,40 @@ jobs:
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/distribution.mobileprovision 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: | run: |
flutter clean flutter clean
flutter pub get flutter pub get
# On force le build en Ad-Hoc
flutter build ipa --release --export-method ad-hoc flutter build ipa --release --export-method ad-hoc
- name: Envoi Firebase iOS - name: 5. Debug & Envoi Firebase iOS
env: env:
FIREBASE_IOS_APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }} FIREBASE_IOS_APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }}
run: | run: |
cd ios cd ios
# Utilisation du Gemfile stabilisé echo "source 'https://rubygems.org'\ngem 'fastlane'\ngem 'fastlane-plugin-firebase_app_distribution'" > Gemfile
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 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 # ON CHERCHE L'IPA PARTOUT ET ON LISTE TOUT SI PAS TROUVÉ
bundle _2.7.2_ update echo "🔍 Recherche de l'IPA..."
IPA_PATH=$(find .. -name "*.ipa" | head -n 1)
# RECHERCHE DYNAMIQUE DE L'IPA if [ -z "$IPA_PATH" ]; then
IPA_FILE=$(find ../build/ios/ipa -name "*.ipa" | head -n 1) echo "❌ IPA NON GÉNÉRÉE. Listing du dossier build pour comprendre :"
echo "📦 IPA trouvée : $IPA_FILE" ls -R ../build
exit 1
bundle _2.7.2_ exec fastlane run firebase_app_distribution \ fi
echo "📦 IPA trouvée : $IPA_PATH"
bundle exec fastlane run firebase_app_distribution \
app:"$FIREBASE_IOS_APP_ID" \ app:"$FIREBASE_IOS_APP_ID" \
ipa_path:"$IPA_FILE" \ ipa_path:"$IPA_PATH" \
service_credentials_file:"firebase_credentials.json" service_credentials_file:"firebase_credentials.json"
- name: Nettoyage Final - name: 6. Nettoyage
if: always() if: always()
run: | run: security delete-keychain build.keychain || true
security list-keychains -d user -s login.keychain
security delete-keychain build.keychain || true