From 22ee853a47107013a9bfcd4ed9eff534c8c47675 Mon Sep 17 00:00:00 2001 From: Rohan Taneja Date: Wed, 21 Jun 2023 06:02:58 +0200 Subject: [PATCH] chore: Android fastlane setup (#11) --- .gitignore | 2 ++ android/.gitignore | 5 +++++ android/app/build.gradle | 17 ++++++++++++++--- android/fastlane/Fastfile | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 android/fastlane/Fastfile diff --git a/.gitignore b/.gitignore index 55395bc..af9f689 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ app.*.map.json # FVM .fvm/flutter_sdk + +build/ diff --git a/android/.gitignore b/android/.gitignore index 6f56801..a0086c8 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -11,3 +11,8 @@ GeneratedPluginRegistrant.java key.properties **/*.keystore **/*.jks + +fastlane/report.xml +fastlane/Appfile +fastlane/service_account.json +fastlane/README.md diff --git a/android/app/build.gradle b/android/app/build.gradle index 32eede4..ab025dd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -54,12 +54,23 @@ android { versionName flutterVersionName } - buildTypes { + signingConfigs { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. + storeFile file('../fastlane/rhntnj-keystore.jks') + keyAlias 'fluttercon' + keyPassword project.findProperty('fluttercon-key-password') ?: '' + storePassword project.findProperty('keystore-password') ?: '' + } + } + + buildTypes { + debug { signingConfig signingConfigs.debug } + + release { + signingConfig signingConfigs.release + } } } diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile new file mode 100644 index 0000000..e20ac46 --- /dev/null +++ b/android/fastlane/Fastfile @@ -0,0 +1,34 @@ +default_platform(:android) + +APP_ID_PRODUCTION = "com.rohantaneja.fluttercon" + +platform :android do + + private_lane :cleanup do + sh "fvm flutter clean" + sh "fvm flutter packages get" + end + + desc "Build App" + private_lane :build_app do + cleanup + gradle(task: "clean", print_command: true) + gradle( + task: "bundle", + build_type: "Release", + print_command: true + ) + end + + desc "Upload Production App to Google Play Store" + lane :upload_production do + build_app(app_id: APP_ID_PRODUCTION, should_build_app_bundle: true) + upload_to_play_store( + track: "internal", + package_name: APP_ID_PRODUCTION, + json_key: "./fastlane/service_account.json", + aab: "../build/app/outputs/bundle/Release/app-release.aab", + ) + end + +end \ No newline at end of file