Skip to content

Commit 22ee853

Browse files
authored
chore: Android fastlane setup (#11)
1 parent 0daa4a8 commit 22ee853

4 files changed

Lines changed: 55 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ app.*.map.json
4545

4646
# FVM
4747
.fvm/flutter_sdk
48+
49+
build/

android/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ GeneratedPluginRegistrant.java
1111
key.properties
1212
**/*.keystore
1313
**/*.jks
14+
15+
fastlane/report.xml
16+
fastlane/Appfile
17+
fastlane/service_account.json
18+
fastlane/README.md

android/app/build.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,23 @@ android {
5454
versionName flutterVersionName
5555
}
5656

57-
buildTypes {
57+
signingConfigs {
5858
release {
59-
// TODO: Add your own signing config for the release build.
60-
// Signing with the debug keys for now, so `flutter run --release` works.
59+
storeFile file('../fastlane/rhntnj-keystore.jks')
60+
keyAlias 'fluttercon'
61+
keyPassword project.findProperty('fluttercon-key-password') ?: ''
62+
storePassword project.findProperty('keystore-password') ?: ''
63+
}
64+
}
65+
66+
buildTypes {
67+
debug {
6168
signingConfig signingConfigs.debug
6269
}
70+
71+
release {
72+
signingConfig signingConfigs.release
73+
}
6374
}
6475
}
6576

android/fastlane/Fastfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
default_platform(:android)
2+
3+
APP_ID_PRODUCTION = "com.rohantaneja.fluttercon"
4+
5+
platform :android do
6+
7+
private_lane :cleanup do
8+
sh "fvm flutter clean"
9+
sh "fvm flutter packages get"
10+
end
11+
12+
desc "Build App"
13+
private_lane :build_app do
14+
cleanup
15+
gradle(task: "clean", print_command: true)
16+
gradle(
17+
task: "bundle",
18+
build_type: "Release",
19+
print_command: true
20+
)
21+
end
22+
23+
desc "Upload Production App to Google Play Store"
24+
lane :upload_production do
25+
build_app(app_id: APP_ID_PRODUCTION, should_build_app_bundle: true)
26+
upload_to_play_store(
27+
track: "internal",
28+
package_name: APP_ID_PRODUCTION,
29+
json_key: "./fastlane/service_account.json",
30+
aab: "../build/app/outputs/bundle/Release/app-release.aab",
31+
)
32+
end
33+
34+
end

0 commit comments

Comments
 (0)