-
-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathFastfile
More file actions
140 lines (113 loc) · 4.24 KB
/
Fastfile
File metadata and controls
140 lines (113 loc) · 4.24 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# 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
sh("bundle install")
default_platform(:android)
desc "Create testing release"
lane :testing do
gradle(task: "clean assembleCi")
end
desc "Create and deploy production release"
lane :production do
prompt(text: "Did you write whats new?")
version_code = get_properties_value(key: "VERSION_CODE", path: "./app/version.properties")
version_name = get_properties_value(key: "VERSION_NAME", path: "./app/version.properties")
# Don't create changelog for f-droid because not committing it
# File.write("metadata/android/en-US/changelogs/" + version_code + ".txt", whats_new)
# Check Rust formatting and run tests
Dir.chdir("../evdev/src/main/rust/evdev_manager") do
sh("cargo fmt --check")
sh("cargo test --package evdev_manager_core")
end
Dir.chdir("..") do
gradle(task: "testDebugUnitTest")
end
github_token = prompt(
text: "Github token: ",
secure_text: true
)
ENV["KEYSTORE_PASSWORD"] = prompt(
text: "Key store password: ",
secure_text: true
)
ENV["KEY_PASSWORD"] = prompt(
text: "Key password: ",
secure_text: true
)
# Release the free build to GitHub because billing only works if signed by Google Play
gradle(task: "assembleRelease")
Dir.chdir("..") do
gradle(task: "app:bundleRelease")
end
apk_path_release="app/build/outputs/apk/release/keymapper-" + version_name + "-foss.apk"
# First release to google play so any errors with the descriptions are resolved before
# creating the git tag.
supply(
aab: "../app/build/outputs/bundle/release/app-release.aab",
track: "internal",
skip_upload_apk: true,
# Skip uploading the title because F-droid should not have "Floating buttons" in its title.
skip_upload_metadata: true,
)
whats_new = File.read("../base/src/main/assets/whats-new.txt")
github_release = set_github_release(
repository_name: "keymapperorg/KeyMapper",
api_bearer: github_token,
name: version_name,
tag_name: "v" + version_name,
description: whats_new,
commitish: "master",
upload_assets: [apk_path_release],
is_draft: false,
is_prerelease: false
)
end
desc "Create and deploy internal testing release"
lane :internal do
version_code = get_properties_value(key: "VERSION_CODE", path: "./app/version.properties")
version_name = get_properties_value(key: "VERSION_NAME", path: "./app/version.properties")
# Check Rust formatting and run tests
Dir.chdir("../evdev/src/main/rust/evdev_manager") do
sh("cargo fmt --check")
sh("cargo test --package evdev_manager_core")
end
Dir.chdir("..") do
gradle(task: "ktlintFormat")
gradle(task: "ktlintCheck")
gradle(task: "testDebugUnitTest")
end
# Don't create changelog for f-droid because not committing it
# File.write("metadata/android/en-US/changelogs/" + version_code + ".txt", whats_new)
ENV["KEYSTORE_PASSWORD"] = prompt(
text: "Key store password: ",
secure_text: true
)
ENV["KEY_PASSWORD"] = prompt(
text: "Key password: ",
secure_text: true
)
Dir.chdir("..") do
gradle(task: "app:bundleRelease")
end
# First release to google play so any errors with the descriptions are resolved before
# creating the git tag.
supply(
aab: "../app/build/outputs/bundle/release/app-release.aab",
track: "internal",
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true
)
end