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
Some checks failed
Deploy Flutter to Firebase / deploy-android (push) Has been cancelled
This commit is contained in:
@@ -1,71 +1,44 @@
|
||||
name: Deploy Android to Play Store
|
||||
run-name: Deploy ${{ gitea.actor }} to Internal Track 🚀
|
||||
|
||||
name: Deploy Flutter to Firebase
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release # Se déclenche uniquement sur la branche release
|
||||
branches: release
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest # Le runner Gitea standard
|
||||
deploy-android:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 1. Récupérer le code
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2. Installer Java
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
|
||||
# 3. Installer Flutter
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
cache: true
|
||||
|
||||
# 4. Récupérer les dépendances
|
||||
- name: Flutter Pub Get
|
||||
run: flutter pub get
|
||||
|
||||
# 5. Reconstruire le Keystore depuis le Secret Base64
|
||||
- name: Decode Keystore
|
||||
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > android/app/upload-keystore.jks
|
||||
|
||||
# 6. Créer le fichier key.properties
|
||||
- name: Create key.properties
|
||||
run: |
|
||||
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties
|
||||
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
|
||||
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
|
||||
echo "storeFile=upload-keystore.jks" >> android/key.properties
|
||||
|
||||
# --- NOUVELLE ÉTAPE : Création du fichier .env ---
|
||||
- name: Create .env file
|
||||
run: |
|
||||
echo "GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}" > .env
|
||||
echo "GOOGLE_MAPS_API_KEY_ANDROID=${{ secrets.GOOGLE_MAPS_API_KEY_ANDROID }}" >> .env
|
||||
echo "GOOGLE_MAPS_API_KEY_IOS=${{ secrets.GOOGLE_MAPS_API_KEY_IOS }}" >> .env
|
||||
# -------------------------------------------------
|
||||
|
||||
# 7. Compiler l'AppBundle (.aab)
|
||||
- name: Build AppBundle
|
||||
run: flutter build appbundle --release
|
||||
|
||||
# 8. Envoyer sur le Play Store
|
||||
# Cette action remplace Fastlane manuel, c'est plus simple dans Gitea
|
||||
- name: Upload to Play Store
|
||||
uses: r0adkll/upload-google-play@v1
|
||||
- name: Setup Ruby (pour Fastlane)
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_JSON }}
|
||||
packageName: be.davdayronxl.travel_mate
|
||||
releaseFiles: build/app/outputs/bundle/release/app-release.aab
|
||||
track: internal # 'internal' = Test interne, 'alpha' = Test fermé
|
||||
status: completed
|
||||
ruby-version: '3.0'
|
||||
bundler-cache: true
|
||||
|
||||
- name: Créer le fichier Auth Google
|
||||
run: echo "${{ secrets.FIREBASE_CREDENTIALS }}" > ./android/firebase_credentials.json
|
||||
|
||||
- name: Créer key.properties
|
||||
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" > ./android/key.properties
|
||||
|
||||
- name: Lancer Fastlane Android
|
||||
working-directory: ./android
|
||||
env:
|
||||
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||
FIREBASE_ANDROID_APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }}
|
||||
run: |
|
||||
bundle install
|
||||
bundle exec fastlane deploy_firebase
|
||||
Reference in New Issue
Block a user