forked from KyberNetwork/KyberSwap-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fastfile
199 lines (173 loc) · 6.29 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.62.1"
default_platform :ios
platform :ios do
before_all do
end
lane :tests do
cocoapods(use_bundle_exec: false)
run_tests(workspace: "KyberNetwork.xcworkspace",
devices: ["iPhone 6s", "iPhone 6s Plus"],
scheme: "KyberNetworkTests",
clean: false)
end
def screenshots
snapshot
frameit(white: true)
end
desc "Increase build number"
lane :increase_build do
ensure_git_branch(branch: "release")
ensure_git_status_clean
git_pull
increment_build_number()
git_add
version_number = get_version_number(xcodeproj: "KyberNetwork.xcodeproj")
build_number = get_build_number(xcodeproj: "KyberNetwork.xcodeproj")
git_commit(path: ["./*.plist", "KyberNetwork.xcodeproj/project.pbxproj"], message: "Increase build number " + build_number + " version " + version_number)
push_to_git_remote(
remote: "origin",
local_branch: "release",
remote_branch: "release",
tags: false
)
end
desc "Increase version and build number"
lane :increase_version do
ensure_git_branch(branch: "release")
ensure_git_status_clean
git_pull
increment_build_number()
increment_version_number()
git_add
version_number = get_version_number(xcodeproj: "KyberNetwork.xcodeproj")
build_number = get_build_number(xcodeproj: "KyberNetwork.xcodeproj")
git_commit(path: ["./*.plist", "KyberNetwork.xcodeproj/project.pbxproj"], message: "Increase version and build number " + build_number + " version " + version_number)
push_to_git_remote(
remote: "origin",
local_branch: "release",
remote_branch: "release",
tags: false
)
end
desc "TestFlight deployment to itunes connect"
lane :beta do
ensure_git_branch(branch: "release")
ensure_git_status_clean
git_pull
cocoapods(use_bundle_exec: false)
build_app(
scheme: "KyberNetwork",
export_method: "app-store",
export_options: {
iCloudContainerEnvironment: "Production",
teamID: "7N9YDG6SF9",
provisioningProfiles: {
"com.kyberswap.ios" => "Kyberswap iOS Distribution Appstore"
}
}
)
old_build_number = get_build_number(xcodeproj: "KyberNetwork.xcodeproj")
notification(subtitle: "Built Successfully!", message: "Start uploading build " + old_build_number + " to TestFlight.")
upload_to_testflight(
skip_waiting_for_build_processing: true,
)
notification(subtitle: "Uploaded Successfully!", message: "New build (" + old_build_number + ") has been uploaded successfully to TestFlight. Waiting for processing.")
increment_build_number()
git_add
version_number = get_version_number(xcodeproj: "KyberNetwork.xcodeproj")
build_number = get_build_number(xcodeproj: "KyberNetwork.xcodeproj")
git_commit(path: ["./*.plist", "KyberNetwork.xcodeproj/project.pbxproj"], message: "Increase build number " + build_number + " version " + version_number)
push_to_git_remote(
remote: "origin",
local_branch: "release",
remote_branch: "release",
tags: false
)
end
desc "Upload current build to TestFlight"
lane :upload_testflight do
ensure_git_branch(branch: "release")
ensure_git_status_clean
old_build_number = get_build_number(xcodeproj: "KyberNetwork.xcodeproj")
notification(subtitle: "Built Successfully!", message: "Start uploading build " + old_build_number + " to TestFlight.")
upload_to_testflight(
skip_waiting_for_build_processing: true,
)
notification(subtitle: "Uploaded Successfully!", message: "New build (" + old_build_number + ") has been uploaded successfully to TestFlight. Waiting for processing.")
increment_build_number()
git_add
version_number = get_version_number(xcodeproj: "KyberNetwork.xcodeproj")
build_number = get_build_number(xcodeproj: "KyberNetwork.xcodeproj")
git_commit(path: ["./*.plist", "KyberNetwork.xcodeproj/project.pbxproj"], message: "Increase build number " + build_number + " version " + version_number)
push_to_git_remote(
remote: "origin",
local_branch: "release",
remote_branch: "release",
tags: false
)
end
desc "Deploy a new version to the App Store"
lane :release do
cocoapods(use_bundle_exec: false)
increment_build_number
ensure_git_branch()
increment_version_number(bump_type: "patch")
cert
match(type: "appstore", readonly: true)
gym(scheme: "KyberNetwork")
commit_version_bump(message: "Version Bump", force: true)
deliver(force: true)
push_to_git_remote
end
desc "Screenshots"
lane :screenshots do
screenshots
end
desc "Localize"
lane :localize do
run_localizer
end
lane :update_lokalise do
lokalise_metadata(
api_token: ENV['LOKALISE_API_TOKEN'],
project_identifier: ENV['LOKALISE_STORE_PROJECT_ID'],
action: "update_lokalise",
add_languages: true,
override_translation: false
)
end
lane :update_itunes do
lokalise_metadata(
api_token: ENV['LOKALISE_API_TOKEN'],
project_identifier: ENV['LOKALISE_STORE_PROJECT_ID'],
action: "update_itunes"
)
end
# You can define as many lanes as you want
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new App Update."
# )
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://docs.fastlane.tools/actions
# fastlane reports which actions are used. No personal data is recorded.
# Learn more at https://github.com/fastlane/fastlane#metrics