Some checks failed
Deploy Flutter to Firebase (Mac) / deploy-android (push) Failing after 1m46s
79 lines
2.9 KiB
YAML
79 lines
2.9 KiB
YAML
name: Deploy Flutter to Firebase (Mac)
|
|
on:
|
|
push:
|
|
branches: release
|
|
|
|
jobs:
|
|
deploy-android:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Vérifier l'installation Flutter
|
|
run: flutter doctor -v
|
|
|
|
- name: Installer les dépendances Flutter
|
|
run: flutter pub get
|
|
|
|
- name: Créer les fichiers secrets
|
|
run: |
|
|
echo "${{ secrets.ENV_FILE }}" > .env
|
|
echo "${{ secrets.FIREBASE_CREDENTIALS }}" > ./android/firebase_credentials.json
|
|
|
|
- name: Lancer Fastlane (Déploiement)
|
|
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. Config Ruby
|
|
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
|
|
export GEM_HOME=$PWD/vendor/bundle
|
|
export GEM_PATH=$PWD/vendor/bundle
|
|
export PATH=$GEM_HOME/bin:$PATH
|
|
|
|
# 2. Génération Keystore & Properties (Méthode Validée ✅)
|
|
echo "🔓 Décodage du Keystore..."
|
|
echo "$ANDROID_KEYSTORE_BASE64" | base64 -D > keystore.jks
|
|
KEYSTORE_PATH=$(pwd)/keystore.jks
|
|
|
|
echo "$RAW_PROPERTIES" > temp_props.txt
|
|
STORE_PASS=$(grep "storePassword" temp_props.txt | cut -d'=' -f2 | tr -d '\r')
|
|
KEY_PASS=$(grep "keyPassword" temp_props.txt | cut -d'=' -f2 | tr -d '\r')
|
|
KEY_ALIAS=$(grep "keyAlias" temp_props.txt | cut -d'=' -f2 | tr -d '\r')
|
|
|
|
# On recrée key.properties proprement
|
|
echo "storePassword=$STORE_PASS" > key.properties
|
|
echo "keyPassword=$KEY_PASS" >> key.properties
|
|
echo "keyAlias=$KEY_ALIAS" >> key.properties
|
|
echo "storeFile=$KEYSTORE_PATH" >> key.properties
|
|
|
|
# 3. Préparation Gemfile (Avec le plugin Firebase cette fois !)
|
|
rm -rf vendor Gemfile.lock .bundle
|
|
|
|
echo "source 'https://rubygems.org'" > Gemfile
|
|
echo "gem 'fastlane', '>= 2.210.0'" >> Gemfile
|
|
|
|
# --- 🔌 LE PLUGIN MANQUANT 🔌 ---
|
|
echo "gem 'fastlane-plugin-firebase_app_distribution'" >> Gemfile
|
|
|
|
# --- 🚑 CORRECTIFS RUBY 3.4 🚑 ---
|
|
echo "gem 'abbrev'" >> Gemfile
|
|
echo "gem 'ostruct'" >> Gemfile
|
|
echo "gem 'mutex_m'" >> Gemfile
|
|
echo "gem 'base64'" >> Gemfile
|
|
echo "gem 'csv'" >> Gemfile
|
|
echo "gem 'bigdecimal'" >> Gemfile
|
|
echo "gem 'drb'" >> Gemfile
|
|
echo "gem 'nkf'" >> Gemfile
|
|
|
|
# 4. Installation & Lancement
|
|
echo "⬇️ Installation..."
|
|
gem install bundler -v 2.7.2 --force --no-document
|
|
bundle _2.7.2_ update --jobs 4
|
|
|
|
echo "🚀 Déploiement vers Firebase..."
|
|
bundle _2.7.2_ exec fastlane deploy_firebase |