-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fastfile
54 lines (45 loc) · 1.64 KB
/
Fastfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
update_fastlane
default_platform(:android)
platform :android do
lane :set_build_code_internal do
versions = google_play_track_version_codes(
track: "internal",
json_key: "./keys.json"
)
last_version = versions[0].to_i
Dir.chdir("../..") do
re = /version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*/i
config = File.read("./pubspec.yaml")
version_name = config.match(re).captures
subst = "version: #{version_name[0]}+#{last_version+2}"
result = config.gsub(re, subst)
File.open("./pubspec.yaml", 'w') { |file| file.write(result) }
end
end
lane :deploy_internal_test do
versions = google_play_track_version_codes(
track: "internal",
json_key: "./keys.json"
)
last_version = versions[0].to_i
upload_to_play_store(track: 'internal', aab: '../build/app/outputs/bundle/release/app-release.aab', version_code: "#{last_version+1}")
end
lane :deploy_candidate do
upload_to_play_store(track: 'internal', track_promote_to: "beta", deactivate_on_promote: false, skip_upload_changelogs: true)
end
lane :deploy_release do
upload_to_play_store(track: 'beta', track_promote_to: "production", deactivate_on_promote: false, skip_upload_changelogs: true)
end
end