test 32
This commit is contained in:
@@ -1,36 +1,31 @@
|
|||||||
name: Deploy TravelMate Final Fix
|
name: Deploy TravelMate (Full Mobile)
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release
|
- release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-all:
|
# --- JOB 1 : ANDROID (Génération APK) ---
|
||||||
|
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: 1. Setup Environnement & Assets
|
- name: Configuration Flutter & Secrets
|
||||||
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: 2. Build Android (APK)
|
- name: Build & Deploy Android
|
||||||
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
|
||||||
@@ -38,19 +33,37 @@ 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
|
||||||
|
|
||||||
cd .. && flutter build apk --release && cd android
|
# 2. Gemfile (Correctifs Ruby 3.4 inclus)
|
||||||
|
echo "source 'https://rubygems.org'" > Gemfile
|
||||||
# Ruby Patches pour Ruby 3.4
|
echo "gem 'fastlane', '>= 2.230.0'" >> Gemfile
|
||||||
echo "source 'https://rubygems.org'\ngem 'fastlane'\ngem 'fastlane-plugin-firebase_app_distribution'" > 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
|
|
||||||
|
|
||||||
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" \
|
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"
|
||||||
|
|
||||||
- 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:
|
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 }}
|
||||||
@@ -65,40 +78,93 @@ 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: 4. Build IPA (iOS)
|
- name: Build IPA avec xcodebuild
|
||||||
|
env:
|
||||||
|
TEAM_ID: ${{ secrets.IOS_TEAM_ID }}
|
||||||
|
BUNDLE_ID: ${{ secrets.IOS_BUNDLE_ID }}
|
||||||
run: |
|
run: |
|
||||||
flutter clean
|
flutter clean
|
||||||
flutter pub get
|
flutter pub get
|
||||||
# On force le build en Ad-Hoc
|
flutter build ios --release --no-codesign
|
||||||
flutter build ipa --release --export-method ad-hoc
|
|
||||||
|
|
||||||
- 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:
|
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
|
||||||
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
|
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É
|
gem install bundler -v 2.7.2 --no-document
|
||||||
echo "🔍 Recherche de l'IPA..."
|
bundle _2.7.2_ update
|
||||||
IPA_PATH=$(find .. -name "*.ipa" | head -n 1)
|
|
||||||
|
|
||||||
if [ -z "$IPA_PATH" ]; then
|
# RECHERCHE DYNAMIQUE DE L'IPA
|
||||||
echo "❌ IPA NON GÉNÉRÉE. Listing du dossier build pour comprendre :"
|
IPA_FILE=$(find ../build/ios/ipa -name "*.ipa" | head -n 1)
|
||||||
ls -R ../build
|
|
||||||
|
if [ -z "$IPA_FILE" ]; then
|
||||||
|
echo "❌ ERREUR : Aucun fichier IPA trouvé !"
|
||||||
|
echo "Contenu du dossier :"
|
||||||
|
ls -R ../build/ios/
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "📦 IPA trouvée : $IPA_PATH"
|
echo "📦 IPA trouvée : $IPA_FILE"
|
||||||
bundle exec fastlane run firebase_app_distribution \
|
|
||||||
|
bundle _2.7.2_ exec fastlane run firebase_app_distribution \
|
||||||
app:"$FIREBASE_IOS_APP_ID" \
|
app:"$FIREBASE_IOS_APP_ID" \
|
||||||
ipa_path:"$IPA_PATH" \
|
ipa_path:"$IPA_FILE" \
|
||||||
service_credentials_file:"firebase_credentials.json"
|
service_credentials_file:"firebase_credentials.json"
|
||||||
|
|
||||||
- name: 6. Nettoyage
|
- name: Nettoyage Final
|
||||||
if: always()
|
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