Skip to content

Commit ce091d2

Browse files
committed
ci(fastlane): add Appfile for Google Play JSON key configuration and update Fastfile to use supply for uploads
1 parent 3ec670f commit ce091d2

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

fastlane/Appfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package_name("com.xdcobra.fluttida")
2+
# In CI we write the Google Play JSON key to /tmp/google-play.json
3+
json_key_file("/tmp/google-play.json")

fastlane/Fastfile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ default_platform(:android)
33
platform :android do
44
desc "Upload signed AAB/APK to Play closed track"
55
lane :deploy_closed do
6-
json_key = '/tmp/google-play.json'
7-
# Ensure we search from the repository root so Fastlane's working
8-
# directory (which may be the `fastlane` folder) doesn't hide the
9-
# downloaded `./artifacts` directory.
106
repo_root = File.expand_path('..', __dir__)
117
aab = Dir[File.join(repo_root, 'artifacts', '**', '*.aab')].first
128
apk = Dir[File.join(repo_root, 'artifacts', '**', '*.apk')].first
@@ -15,37 +11,36 @@ platform :android do
1511
version_name = ENV['VERSION_NAME'] || ENV['ORG_GRADLE_PROJECT_VERSION_NAME']
1612
release_name = version_code && version_name ? "#{version_code} (#{version_name})" : nil
1713

18-
# try to find mapping file inside artifacts (if the build uploaded it)
1914
mapping = Dir[File.join(repo_root, 'artifacts', '**', 'mapping*.txt')].first
2015

16+
validate_only = ENV['VALIDATE_ONLY'] == 'true'
17+
2118
if aab
2219
params = {
23-
track: 'closed',
2420
aab: aab,
25-
json_key: json_key,
26-
release_name: release_name,
21+
track: 'alpha',
22+
validate_only: validate_only,
2723
skip_upload_metadata: true,
2824
skip_upload_images: true,
2925
skip_upload_screenshots: true,
3026
skip_upload_changelogs: true
3127
}
3228
params[:mapping] = mapping if mapping
33-
upload_to_play_store(**params)
29+
supply(**params)
3430
elsif apk
3531
params = {
36-
track: 'closed',
3732
apk: apk,
38-
json_key: json_key,
39-
release_name: release_name,
33+
track: 'alpha',
34+
validate_only: validate_only,
4035
skip_upload_metadata: true,
4136
skip_upload_images: true,
4237
skip_upload_screenshots: true,
4338
skip_upload_changelogs: true
4439
}
4540
params[:mapping] = mapping if mapping
46-
upload_to_play_store(**params)
41+
supply(**params)
4742
else
4843
UI.user_error!("No AAB or APK found in ./artifacts to upload to Play Store")
4944
end
5045
end
51-
end
46+
end

0 commit comments

Comments
 (0)