feat: Set up Fastlane for Android with Firebase App Distribution and adjust build configurations.
Some checks failed
Deploy Flutter to Firebase / deploy-android (push) Has been cancelled

This commit is contained in:
Van Leemput Dayron
2025-12-09 11:07:09 +01:00
parent 14d2761832
commit b96c988e80
7 changed files with 305 additions and 56 deletions

26
android/fastlane/Fastfile Normal file
View File

@@ -0,0 +1,26 @@
default_platform(:android)
platform :android do
desc "Déploiement Firebase via Gitea"
lane :deploy_firebase do
# 1. Décoder le Keystore depuis les secrets Gitea (voir Phase 4)
# On vérifie si le fichier existe déjà pour éviter d'écraser en local
if ENV['ANDROID_KEYSTORE_BASE64']
File.open("upload-keystore.jks", "wb") do |f|
f.write(Base64.decode64(ENV['ANDROID_KEYSTORE_BASE64']))
end
end
# 2. Construire l'APK
flutter_build(build: "apk")
# Note: Fastlane a un plugin flutter, ou utilisez sh("flutter build apk --release")
# 3. Envoyer à Firebase
firebase_app_distribution(
app: ENV["FIREBASE_ANDROID_APP_ID"],
service_credentials_file: "firebase_credentials.json",
groups: "testers",
release_notes: "Build automatique depuis Gitea Commit: #{ENV['GITHUB_SHA']}"
)
end
end