-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFastfile
75 lines (61 loc) · 2.63 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
# 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
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:android)
platform :android do
desc "Promote a Beta Build to the Release Channel"
lane :release do
tag = ENV['TRAVIS_TAG'] || ''
if tag =~ /.*-ios/
next
end
upload_to_play_store(track: 'internal',
track_promote_to: 'production',
json_key: './fastlane/GooglePlayAPI.json',
skip_upload_metadata: true,
skip_upload_screenshots: true,
skip_upload_images: true)
cru_notify_users(message: "#{ENV['CRU_PROJECT_NAME']} Android Beta Build promoted to Play Store Release Channel. DEVELOPERS: Remember to bump version number for the next build!")
end
desc "Submit a new Beta Build to the Play Store Beta Channel"
lane :beta do
cru_build_app
upload_to_play_store(track: 'internal',
json_key: './fastlane/GooglePlayAPI.json',
mapping: ENV['CRU_MAPPING_FILE'],
skip_upload_metadata: true,
skip_upload_screenshots: true,
skip_upload_images: true)
cru_notify_users(message: "#{ENV['CRU_PROJECT_NAME']} Android Beta Build released to Play Store Internal Test Channel.")
end
lane :cru_build_app do
keystore_filename = ENV['GOOGLE_PLAY_UPLOAD_KEYSTORE']
task = ENV['CRU_GRADLE_TASK'] || 'clean assembleRelease'
# this was mind numbing to figure out, no matter which place I put the keystore, the gradle build would
# expect it in the other place. the only working and dumb solution I found was to put it in both places.
sh('cp', "../app/#{keystore_filename}", "../#{keystore_filename}")
gradle(task: task,
print_command: false,
properties: {
'android.injected.signing.store.file': keystore_filename,
'android.injected.signing.store.password': ENV['GOOGLE_PLAY_UPLOAD_KEY_PASSWORD'],
'android.injected.signing.key.alias': ENV['GOOGLE_PLAY_UPLOAD_KEY_ALIAS'],
'android.injected.signing.key.password': ENV['GOOGLE_PLAY_UPLOAD_KEY_PASSWORD'],
})
end
lane :cru_notify_users do |options|
if ENV["SLACK_URL"]
slack(
slack_url: ENV["SLACK_URL"],
fail_on_error: false,
message: options[:message]
)
end
end
end