80 lines
3.0 KiB
YAML
80 lines
3.0 KiB
YAML
name: Deploy Flutter to Firebase iOS (Fixed)
|
|
on:
|
|
push:
|
|
branches: release
|
|
|
|
jobs:
|
|
deploy-ios:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Installer Dépendances
|
|
run: |
|
|
flutter pub get
|
|
cd ios
|
|
# Xcode 26.2 nécessite des pods à jour pour Firebase 12.6.0
|
|
pod install --repo-update || pod update
|
|
cd ..
|
|
|
|
- name: Préparer le Code Signing (Keychain Search List)
|
|
env:
|
|
P12_BASE: ${{ secrets.IOS_P12_BASE64 }}
|
|
P12_PASS: ${{ secrets.IOS_P12_PASSWORD }}
|
|
PROV_BASE: ${{ secrets.IOS_PROVISION_BASE64 }}
|
|
run: |
|
|
# 1. Nettoyage
|
|
security delete-keychain build.keychain || true
|
|
security create-keychain -p "" build.keychain
|
|
security unlock-keychain -p "" build.keychain
|
|
|
|
# 2. AJOUTER À LA LISTE DE RECHERCHE
|
|
# C'est cette commande qui permet à Xcode 26.2 de trouver ton certificat
|
|
security list-keychains -d user -s build.keychain $(security list-keychains -d user | xargs)
|
|
|
|
# 3. Importation du certificat
|
|
echo "$P12_BASE" | base64 -D -o cert.p12
|
|
security import cert.p12 -k build.keychain -P "$P12_PASS" -T /usr/bin/codesign
|
|
|
|
# 4. Autoriser codesign sans popup
|
|
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
|
|
|
|
# 5. Installation du Profil
|
|
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
echo "$PROV_BASE" | base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/distribution.mobileprovision
|
|
|
|
- name: Build IPA (Standard Xcode 26.2)
|
|
run: |
|
|
# On utilise les flags standards. Xcode utilisera le profil installé
|
|
# à l'étape précédente s'il est configuré en 'Manual' dans le projet.
|
|
# Xcode 26.2 utilise son nouveau moteur de build plus rapide ici
|
|
flutter build ipa --release --export-method ad-hoc
|
|
|
|
- name: Envoi Firebase (Bundler 2.7.2)
|
|
env:
|
|
FIREBASE_IOS_APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }}
|
|
run: |
|
|
export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:$PATH"
|
|
gem install bundler -v 2.7.2 --no-document
|
|
cd ios
|
|
bundle _2.7.2_ config set path 'vendor/bundle'
|
|
|
|
# Création Gemfile propre
|
|
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
|
|
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"
|
|
|
|
- name: Nettoyage Final
|
|
if: always()
|
|
run: |
|
|
security list-keychains -d user -s login.keychain
|
|
security delete-keychain build.keychain || true |