Some checks failed
Deploy Flutter to Firebase (Mac) / deploy-android (push) Failing after 2m7s
88 lines
3.4 KiB
YAML
88 lines
3.4 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 (Avec Debug JSON)
|
|
run: |
|
|
echo "${{ secrets.ENV_FILE }}" > .env
|
|
|
|
# --- 📝 ÉCRITURE SÉCURISÉE DU JSON ---
|
|
# On utilise printf pour éviter que le shell ne mange les guillemets
|
|
printf '%s' '${{ secrets.FIREBASE_CREDENTIALS }}' > ./android/firebase_credentials.json
|
|
|
|
echo "---------------------------------------------------"
|
|
echo "⚠️ DEBUG : Vérification du début du JSON Firebase"
|
|
echo "(Ne doit PAS être vide et doit commencer par { \"type\": ... )"
|
|
echo "---------------------------------------------------"
|
|
# On affiche juste les 50 premiers caractères pour ne pas fuiter tout le secret
|
|
head -c 50 ./android/firebase_credentials.json
|
|
echo ""
|
|
echo "---------------------------------------------------"
|
|
|
|
- name: Lancer Fastlane (Final)
|
|
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
|
|
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')
|
|
|
|
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
|
|
rm -rf vendor Gemfile.lock .bundle
|
|
|
|
echo "source 'https://rubygems.org'" > Gemfile
|
|
echo "gem 'fastlane', '>= 2.210.0'" >> Gemfile
|
|
echo "gem 'fastlane-plugin-firebase_app_distribution'" >> Gemfile
|
|
|
|
# Patchs 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 |