-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFastfile
More file actions
67 lines (54 loc) · 1.77 KB
/
Copy pathFastfile
File metadata and controls
67 lines (54 loc) · 1.77 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
# Fastlane configuration for Flutter Android releases.
# Docs: https://docs.fastlane.tools/getting-started/android/release-deployment/
default_platform(:android)
def flutter_project_root
File.expand_path("../..", __dir__)
end
def release_aab_path
File.join(flutter_project_root, "build/app/outputs/bundle/release/app-release.aab")
end
def deploy_track
ENV.fetch("PLAY_STORE_TRACK", "alpha")
end
platform :android do
desc "Build a signed release app bundle with Flutter"
lane :build do
build_name = ENV.fetch("BUILD_NAME")
build_number = ENV.fetch("BUILD_NUMBER")
Dir.chdir(flutter_project_root) do
# sh("flutter", "pub", "get")
sh(
"flutter", "build", "appbundle", "--release",
"--build-name=#{build_name}",
"--build-number=#{build_number}"
)
end
UI.user_error!("AAB not found at #{release_aab_path}") unless File.exist?(release_aab_path)
release_aab_path
end
desc "Deploy a new release to Google Play"
lane :deploy do
build_number = ENV.fetch("BUILD_NUMBER").to_i
UI.user_error!("BUILD_NUMBER must be a positive integer from pubspec.yaml") if build_number <= 0
UI.success("Using version code #{build_number} from pubspec.yaml")
aab = build
track = deploy_track
upload_options = {
aab: aab,
track: track,
json_key_data: ENV.fetch("PLAY_STORE_SERVICE_ACCOUNT_JSON"),
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true
}
if track == "production"
upload_options[:rollout] = "0.1"
upload_options[:release_status] = "inProgress"
else
upload_options[:release_status] = "completed"
end
upload_to_play_store(upload_options)
end
end