test 32
This commit is contained in:
@@ -1,36 +1,31 @@
|
||||
name: Deploy TravelMate Final Fix
|
||||
name: Deploy TravelMate (Full Mobile)
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release
|
||||
|
||||
jobs:
|
||||
deploy-all:
|
||||
# --- JOB 1 : ANDROID (Génération APK) ---
|
||||
deploy-android:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 1. Setup Environnement & Assets
|
||||
- name: Configuration Flutter & Secrets
|
||||
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: 2. Build Android (APK)
|
||||
- name: Build & Deploy Android
|
||||
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
|
||||
@@ -38,19 +33,37 @@ jobs:
|
||||
echo "keyAlias=$(grep 'keyAlias' temp_props.txt | cut -d'=' -f2 | tr -d '\r')" >> key.properties
|
||||
echo "storeFile=$(pwd)/keystore.jks" >> key.properties
|
||||
|
||||
cd .. && flutter build apk --release && cd android
|
||||
|
||||
# Ruby Patches pour Ruby 3.4
|
||||
echo "source 'https://rubygems.org'\ngem 'fastlane'\ngem 'fastlane-plugin-firebase_app_distribution'" > Gemfile
|
||||
# 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
|
||||
bundle install --path vendor/bundle
|
||||
|
||||
bundle exec fastlane run firebase_app_distribution \
|
||||
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 \
|
||||
app:"$FIREBASE_ANDROID_APP_ID" \
|
||||
android_artifact_path:"../build/app/outputs/flutter-apk/app-release.apk" \
|
||||
service_credentials_file:"firebase_credentials.json"
|
||||
|
||||
- name: 3. Préparer iOS (Signing)
|
||||
# --- 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)
|
||||
env:
|
||||
P12_BASE: ${{ secrets.IOS_P12_BASE64 }}
|
||||
P12_PASS: ${{ secrets.IOS_P12_PASSWORD }}
|
||||
@@ -65,40 +78,93 @@ 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: 4. Build IPA (iOS)
|
||||
- name: Build IPA avec xcodebuild
|
||||
env:
|
||||
TEAM_ID: ${{ secrets.IOS_TEAM_ID }}
|
||||
BUNDLE_ID: ${{ secrets.IOS_BUNDLE_ID }}
|
||||
run: |
|
||||
flutter clean
|
||||
flutter pub get
|
||||
# On force le build en Ad-Hoc
|
||||
flutter build ipa --release --export-method ad-hoc
|
||||
flutter build ios --release --no-codesign
|
||||
|
||||
- name: 5. Debug & Envoi Firebase iOS
|
||||
# Créer le dossier de sortie
|
||||
mkdir -p build/ios/ipa
|
||||
|
||||
# Construire l'archive avec xcodebuild
|
||||
cd ios
|
||||
xcodebuild -workspace Runner.xcworkspace \
|
||||
-scheme Runner \
|
||||
-configuration Release \
|
||||
-archivePath ../build/ios/Runner.xcarchive \
|
||||
clean archive \
|
||||
CODE_SIGN_IDENTITY="Apple Distribution" \
|
||||
PROVISIONING_PROFILE_SPECIFIER="distribution" \
|
||||
DEVELOPMENT_TEAM="$TEAM_ID"
|
||||
|
||||
# Export en IPA
|
||||
xcodebuild -exportArchive \
|
||||
-archivePath ../build/ios/Runner.xcarchive \
|
||||
-exportPath ../build/ios/ipa \
|
||||
-exportOptionsPlist exportOptions.plist
|
||||
|
||||
cd ..
|
||||
echo "📦 Contenu du dossier IPA :"
|
||||
ls -lah build/ios/ipa/
|
||||
|
||||
- name: Créer exportOptions.plist
|
||||
run: |
|
||||
cat > ios/exportOptions.plist <<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>method</key>
|
||||
<string>ad-hoc</string>
|
||||
<key>teamID</key>
|
||||
<string>${{ secrets.IOS_TEAM_ID }}</string>
|
||||
<key>provisioningProfiles</key>
|
||||
<dict>
|
||||
<key>${{ secrets.IOS_BUNDLE_ID }}</key>
|
||||
<string>distribution</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
- name: Envoi Firebase iOS
|
||||
env:
|
||||
FIREBASE_IOS_APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }}
|
||||
run: |
|
||||
cd ios
|
||||
echo "source 'https://rubygems.org'\ngem 'fastlane'\ngem 'fastlane-plugin-firebase_app_distribution'" > Gemfile
|
||||
# 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
|
||||
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
|
||||
|
||||
# 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)
|
||||
gem install bundler -v 2.7.2 --no-document
|
||||
bundle _2.7.2_ update
|
||||
|
||||
if [ -z "$IPA_PATH" ]; then
|
||||
echo "❌ IPA NON GÉNÉRÉE. Listing du dossier build pour comprendre :"
|
||||
ls -R ../build
|
||||
# RECHERCHE DYNAMIQUE DE L'IPA
|
||||
IPA_FILE=$(find ../build/ios/ipa -name "*.ipa" | head -n 1)
|
||||
|
||||
if [ -z "$IPA_FILE" ]; then
|
||||
echo "❌ ERREUR : Aucun fichier IPA trouvé !"
|
||||
echo "Contenu du dossier :"
|
||||
ls -R ../build/ios/
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "📦 IPA trouvée : $IPA_PATH"
|
||||
bundle exec fastlane run firebase_app_distribution \
|
||||
echo "📦 IPA trouvée : $IPA_FILE"
|
||||
|
||||
bundle _2.7.2_ exec fastlane run firebase_app_distribution \
|
||||
app:"$FIREBASE_IOS_APP_ID" \
|
||||
ipa_path:"$IPA_PATH" \
|
||||
ipa_path:"$IPA_FILE" \
|
||||
service_credentials_file:"firebase_credentials.json"
|
||||
|
||||
- name: 6. Nettoyage
|
||||
- name: Nettoyage Final
|
||||
if: always()
|
||||
run: security delete-keychain build.keychain || true
|
||||
run: |
|
||||
security list-keychains -d user -s login.keychain
|
||||
security delete-keychain build.keychain || true
|
||||
Reference in New Issue
Block a user