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
|
# 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
#
opt_out_usage
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:android)
platform :android do
desc "Tags the current version and publish it on F-Droid"
lane :release_fdroid do
unittests
instrumentedtests
info = computeversion
tag(info)
gradle(
task: 'assemble',
build_type: 'Release',
flavor: 'play'
)
end
desc "Publish on Google Play Store Beta channel"
lane :release_play_store_beta do
end
desc "Publish on Google Play Store Production channel"
lane :release_play_store_prod do
end
desc "Runs Unit tests"
private_lane :unittests do
gradle(task: "testPlayReleaseUnitTest")
end
desc "Runs Instrumented tests"
private_lane :instrumentedtests do
gradle(task: "connectedDevDebugAndroidTest")
end
desc "compute version"
private_lane :computeversion do |options|
File.open("../app/build.gradle","r") do |f|
text = f.read
versionCode = text.match(/versionCode ([0-9]*)$/)
versionCodeInt = versionCode[1].to_i
versionName = text.match(/versionName "([0-9,\.]*)"$/)
versionNameString = versionName[1].to_s
print "VersionCode: " + versionCodeInt.to_s + "\n"
print "Name: " + versionNameString + "\n"
answer = prompt(text: "is this okay?", boolean: true)
if !answer
exit
end
{ "versionCode" => versionCode.to_s, "versionName" => versionNameString }
end
end
desc "Adding git tag"
private_lane :tag do |options|
add_git_tag(
tag: options["versionName"],
sign: true
)
push_git_tags(
tag: options["versionName"])
end
private_lane :SignedRelease do |options|
gradle(
task: 'assemble',
flavor: 'play',
build_type: 'Release',
print_command: false,
properties: {
"android.injected.signing.store.file" => ENV["FASTLANE_NEXTCLOUD_STORE_FILE"],
"android.injected.signing.store.password" => ENV["FASTLANE_NEXTCLOUD_STORE_PASSWORD"],
"android.injected.signing.key.alias" => ENV["FASTLANE_NEXTCLOUD_DECK_KEY_ALIAS"],
"android.injected.signing.key.password" => ENV["FASTLANE_NEXTCLOUD_DECK_KEY_PASSWORD"],
}
)
end
end
|