test 29
This commit is contained in:
@@ -2,19 +2,20 @@ name: Deploy TravelMate (Android & iOS)
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release # Assure-toi de pousser sur cette branche exacte
|
- release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# --- JOB 1 : ANDROID (APK) ---
|
# --- JOB 1 : ANDROID (Génération APK) ---
|
||||||
deploy-android:
|
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: Dépendances Flutter & Secrets
|
- name: Configuration Flutter & Secrets
|
||||||
run: |
|
run: |
|
||||||
flutter pub get
|
flutter pub get
|
||||||
|
# On crée le .env à la racine pour éviter l'erreur d'asset
|
||||||
echo "${{ secrets.ENV_FILE }}" > .env
|
echo "${{ secrets.ENV_FILE }}" > .env
|
||||||
printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./android/firebase_credentials.json
|
printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./android/firebase_credentials.json
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ jobs:
|
|||||||
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 & Properties
|
# 1. Préparation du 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
|
||||||
@@ -35,14 +36,14 @@ jobs:
|
|||||||
|
|
||||||
# 2. Gemfile Ruby 3.4 Patches
|
# 2. Gemfile Ruby 3.4 Patches
|
||||||
echo "source 'https://rubygems.org'" > Gemfile
|
echo "source 'https://rubygems.org'" > Gemfile
|
||||||
echo "gem 'fastlane', '>= 2.210.0'" >> Gemfile
|
echo "gem 'fastlane', '>= 2.230.0'" >> Gemfile
|
||||||
echo "gem '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; 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
|
||||||
|
|
||||||
gem install bundler -v 2.7.2 --no-document
|
gem install bundler -v 2.7.2 --no-document
|
||||||
bundle _2.7.2_ update
|
bundle _2.7.2_ install
|
||||||
|
|
||||||
# 3. Build APK
|
# 3. Build APK (On remonte à la racine)
|
||||||
cd .. && flutter build apk --release && cd android
|
cd .. && flutter build apk --release && cd android
|
||||||
|
|
||||||
# 4. Envoi Firebase
|
# 4. Envoi Firebase
|
||||||
@@ -50,23 +51,23 @@ jobs:
|
|||||||
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" \
|
||||||
release_notes:"Android APK stable - Xcode 26.2"
|
release_notes:"Android build stable - Xcode 26.2 env"
|
||||||
|
|
||||||
# --- JOB 2 : IOS (IPA) ---
|
# --- JOB 2 : IOS (Génération IPA) ---
|
||||||
deploy-ios:
|
deploy-ios:
|
||||||
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: Dépendances iOS & Secrets
|
- name: Dépendances Flutter & iOS
|
||||||
run: |
|
run: |
|
||||||
flutter pub get
|
flutter pub get
|
||||||
echo "${{ secrets.ENV_FILE }}" > .env
|
echo "${{ secrets.ENV_FILE }}" > .env
|
||||||
printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./ios/firebase_credentials.json
|
printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./ios/firebase_credentials.json
|
||||||
cd ios && (pod install --repo-update || pod update)
|
cd ios && (pod install --repo-update || pod update)
|
||||||
|
|
||||||
- name: Préparer le Code Signing (Safe Mode Mac Perso)
|
- name: Préparer le Code Signing (Mode Safe)
|
||||||
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 }}
|
||||||
@@ -75,7 +76,6 @@ jobs:
|
|||||||
security delete-keychain build.keychain || true
|
security delete-keychain build.keychain || true
|
||||||
security create-keychain -p "" build.keychain
|
security create-keychain -p "" build.keychain
|
||||||
security unlock-keychain -p "" build.keychain
|
security unlock-keychain -p "" build.keychain
|
||||||
# Crucial pour Xcode 26.2 : ajouter à la liste de recherche
|
|
||||||
security list-keychains -d user -s build.keychain $(security list-keychains -d user | xargs)
|
security list-keychains -d user -s build.keychain $(security list-keychains -d user | xargs)
|
||||||
echo "$P12_BASE" | base64 -D -o cert.p12
|
echo "$P12_BASE" | base64 -D -o cert.p12
|
||||||
security import cert.p12 -k build.keychain -P "$P12_PASS" -T /usr/bin/codesign
|
security import cert.p12 -k build.keychain -P "$P12_PASS" -T /usr/bin/codesign
|
||||||
@@ -84,29 +84,44 @@ jobs:
|
|||||||
echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/distribution.mobileprovision
|
echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/distribution.mobileprovision
|
||||||
|
|
||||||
- name: Build IPA (Standard Xcode 26.2)
|
- name: Build IPA (Standard Xcode 26.2)
|
||||||
run: flutter build ipa --release --export-method ad-hoc
|
run: |
|
||||||
|
# Nettoyage avant build pour garantir la détection des assets
|
||||||
|
flutter clean
|
||||||
|
flutter pub get
|
||||||
|
flutter build ipa --release --export-method ad-hoc
|
||||||
|
|
||||||
- name: Envoi Firebase iOS
|
- 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
|
export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:$PATH"
|
||||||
echo "source 'https://rubygems.org'" > Gemfile
|
|
||||||
echo "gem 'fastlane', '>= 2.210.0'" >> Gemfile
|
|
||||||
echo "gem 'fastlane-plugin-firebase_app_distribution'" >> Gemfile
|
|
||||||
for g in abbrev ostruct mutex_m base64 csv bigdecimal drb nkf; do echo "gem '$g'" >> Gemfile; done
|
|
||||||
|
|
||||||
gem install bundler -v 2.7.2 --no-document
|
gem install bundler -v 2.7.2 --no-document
|
||||||
bundle _2.7.2_ update
|
cd ios
|
||||||
|
|
||||||
|
# Reconstruction du 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
|
||||||
|
|
||||||
|
bundle _2.7.2_ install
|
||||||
|
|
||||||
|
# RECHERCHE DE L'IPA (Plus précise)
|
||||||
|
IPA_FILE=$(find ../build/ios/ipa -name "*.ipa" | head -n 1)
|
||||||
|
echo "📦 IPA localisée : $IPA_FILE"
|
||||||
|
|
||||||
|
if [ -z "$IPA_FILE" ]; then
|
||||||
|
echo "❌ Erreur : IPA introuvable dans ../build/ios/ipa"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
IPA_PATH=$(find .. -name "*.ipa" -not -path "*/Pods/*" | head -n 1)
|
|
||||||
bundle _2.7.2_ 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" \
|
||||||
release_notes:"iOS IPA stable - Xcode 26.2"
|
release_notes: "iOS build stable - Xcode 26.2"
|
||||||
|
|
||||||
- name: Nettoyage Trousseau
|
- name: Nettoyage Final
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
security list-keychains -d user -s login.keychain
|
security list-keychains -d user -s login.keychain
|
||||||
|
|||||||
Reference in New Issue
Block a user