Skip to content

Commit 3b774d9

Browse files
committed
Fastlane for Android
1 parent 0b3a0eb commit 3b774d9

File tree

8 files changed

+245
-2
lines changed

8 files changed

+245
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.env
2+
13
# OSX
24
#
35
.DS_Store

android/.env.sample

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Copy this file as .env and fill with your own values. All are required in order to build and submit APKs to Play Store
2+
3+
#Service account in Google Play for uploading permissions: See https://docs.fastlane.tools/actions/supply
4+
#You normally will have this file outside of the source tree
5+
SERVICE_ACCOUNT_KEY_FILE= #Path to the service account key file
6+
7+
#Key for signing APKs: https://facebook.github.io/react-native/docs/signed-apk-android.html
8+
#You normally will have this file outside of the source tree
9+
ANDROID_KEYSTORE_FILE= #Path to the signing key file
10+
ANDROID_KEYSTORE_PASSWORD= #Password of the signing key file
11+
ANDROID_KEY_ALIAS= #Key alias
12+
ANDROID_KEY_PASSWORD= #Key password

android/Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"

android/Gemfile.lock

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.0)
5+
addressable (2.6.0)
6+
public_suffix (>= 2.0.2, < 4.0)
7+
atomos (0.1.3)
8+
babosa (1.0.2)
9+
claide (1.0.2)
10+
colored (1.2)
11+
colored2 (3.1.2)
12+
commander-fastlane (4.4.6)
13+
highline (~> 1.7.2)
14+
declarative (0.0.10)
15+
declarative-option (0.1.0)
16+
digest-crc (0.4.1)
17+
domain_name (0.5.20180417)
18+
unf (>= 0.0.5, < 1.0.0)
19+
dotenv (2.7.2)
20+
emoji_regex (1.0.1)
21+
excon (0.64.0)
22+
faraday (0.15.4)
23+
multipart-post (>= 1.2, < 3)
24+
faraday-cookie_jar (0.0.6)
25+
faraday (>= 0.7.4)
26+
http-cookie (~> 1.0.0)
27+
faraday_middleware (0.13.1)
28+
faraday (>= 0.7.4, < 1.0)
29+
fastimage (2.1.5)
30+
fastlane (2.125.2)
31+
CFPropertyList (>= 2.3, < 4.0.0)
32+
addressable (>= 2.3, < 3.0.0)
33+
babosa (>= 1.0.2, < 2.0.0)
34+
bundler (>= 1.12.0, < 3.0.0)
35+
colored
36+
commander-fastlane (>= 4.4.6, < 5.0.0)
37+
dotenv (>= 2.1.1, < 3.0.0)
38+
emoji_regex (>= 0.1, < 2.0)
39+
excon (>= 0.45.0, < 1.0.0)
40+
faraday (~> 0.9)
41+
faraday-cookie_jar (~> 0.0.6)
42+
faraday_middleware (~> 0.9)
43+
fastimage (>= 2.1.0, < 3.0.0)
44+
gh_inspector (>= 1.1.2, < 2.0.0)
45+
google-api-client (>= 0.21.2, < 0.24.0)
46+
google-cloud-storage (>= 1.15.0, < 2.0.0)
47+
highline (>= 1.7.2, < 2.0.0)
48+
json (< 3.0.0)
49+
jwt (~> 2.1.0)
50+
mini_magick (~> 4.5.1)
51+
multi_xml (~> 0.5)
52+
multipart-post (~> 2.0.0)
53+
plist (>= 3.1.0, < 4.0.0)
54+
public_suffix (~> 2.0.0)
55+
rubyzip (>= 1.2.2, < 2.0.0)
56+
security (= 0.1.3)
57+
simctl (~> 1.6.3)
58+
slack-notifier (>= 2.0.0, < 3.0.0)
59+
terminal-notifier (>= 2.0.0, < 3.0.0)
60+
terminal-table (>= 1.4.5, < 2.0.0)
61+
tty-screen (>= 0.6.3, < 1.0.0)
62+
tty-spinner (>= 0.8.0, < 1.0.0)
63+
word_wrap (~> 1.0.0)
64+
xcodeproj (>= 1.8.1, < 2.0.0)
65+
xcpretty (~> 0.3.0)
66+
xcpretty-travis-formatter (>= 0.0.3)
67+
gh_inspector (1.1.3)
68+
google-api-client (0.23.9)
69+
addressable (~> 2.5, >= 2.5.1)
70+
googleauth (>= 0.5, < 0.7.0)
71+
httpclient (>= 2.8.1, < 3.0)
72+
mime-types (~> 3.0)
73+
representable (~> 3.0)
74+
retriable (>= 2.0, < 4.0)
75+
signet (~> 0.9)
76+
google-cloud-core (1.3.0)
77+
google-cloud-env (~> 1.0)
78+
google-cloud-env (1.1.0)
79+
faraday (~> 0.11)
80+
google-cloud-storage (1.16.0)
81+
digest-crc (~> 0.4)
82+
google-api-client (~> 0.23)
83+
google-cloud-core (~> 1.2)
84+
googleauth (>= 0.6.2, < 0.10.0)
85+
googleauth (0.6.7)
86+
faraday (~> 0.12)
87+
jwt (>= 1.4, < 3.0)
88+
memoist (~> 0.16)
89+
multi_json (~> 1.11)
90+
os (>= 0.9, < 2.0)
91+
signet (~> 0.7)
92+
highline (1.7.10)
93+
http-cookie (1.0.3)
94+
domain_name (~> 0.5)
95+
httpclient (2.8.3)
96+
json (2.2.0)
97+
jwt (2.1.0)
98+
memoist (0.16.0)
99+
mime-types (3.2.2)
100+
mime-types-data (~> 3.2015)
101+
mime-types-data (3.2019.0331)
102+
mini_magick (4.5.1)
103+
multi_json (1.13.1)
104+
multi_xml (0.6.0)
105+
multipart-post (2.0.0)
106+
nanaimo (0.2.6)
107+
naturally (2.2.0)
108+
os (1.0.1)
109+
plist (3.5.0)
110+
public_suffix (2.0.5)
111+
representable (3.0.4)
112+
declarative (< 0.1.0)
113+
declarative-option (< 0.2.0)
114+
uber (< 0.2.0)
115+
retriable (3.1.2)
116+
rouge (2.0.7)
117+
rubyzip (1.2.3)
118+
security (0.1.3)
119+
signet (0.11.0)
120+
addressable (~> 2.3)
121+
faraday (~> 0.9)
122+
jwt (>= 1.5, < 3.0)
123+
multi_json (~> 1.10)
124+
simctl (1.6.5)
125+
CFPropertyList
126+
naturally
127+
slack-notifier (2.3.2)
128+
terminal-notifier (2.0.0)
129+
terminal-table (1.8.0)
130+
unicode-display_width (~> 1.1, >= 1.1.1)
131+
tty-cursor (0.7.0)
132+
tty-screen (0.7.0)
133+
tty-spinner (0.9.1)
134+
tty-cursor (~> 0.7)
135+
uber (0.1.0)
136+
unf (0.1.4)
137+
unf_ext
138+
unf_ext (0.0.7.6)
139+
unicode-display_width (1.6.0)
140+
word_wrap (1.0.0)
141+
xcodeproj (1.9.0)
142+
CFPropertyList (>= 2.3.3, < 4.0)
143+
atomos (~> 0.1.3)
144+
claide (>= 1.0.2, < 2.0)
145+
colored2 (~> 3.1)
146+
nanaimo (~> 0.2.6)
147+
xcpretty (0.3.0)
148+
rouge (~> 2.0.7)
149+
xcpretty-travis-formatter (1.0.0)
150+
xcpretty (~> 0.2, >= 0.0.7)
151+
152+
PLATFORMS
153+
ruby
154+
155+
DEPENDENCIES
156+
fastlane
157+
158+
BUNDLED WITH
159+
2.0.1

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ android {
105105
applicationId "com.dribia.decodeapp"
106106
minSdkVersion rootProject.ext.minSdkVersion
107107
targetSdkVersion rootProject.ext.targetSdkVersion
108-
versionCode 1
108+
versionCode 25
109109
versionName "2.0"
110110
}
111111
splits {

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
buildscript {
44
ext {
55
buildToolsVersion = "28.0.3"
6-
minSdkVersion = 16
6+
minSdkVersion = 21
77
compileSdkVersion = 28
88
targetSdkVersion = 28
99
supportLibVersion = "28.0.0"

android/fastlane/Appfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
json_key_file(ENV["SERVICE_ACCOUNT_KEY_FILE"]) # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2+
package_name("com.dribia.decodeapp") # e.g. com.krausefx.app

android/fastlane/Fastfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This file contains the fastlane.tools configuration
2+
# You can find the documentation at https://docs.fastlane.tools
3+
#
4+
# For a list of all available actions, check out
5+
#
6+
# https://docs.fastlane.tools/actions
7+
#
8+
# For a list of all available plugins, check out
9+
#
10+
# https://docs.fastlane.tools/plugins/available-plugins
11+
#
12+
13+
# Uncomment the line if you want fastlane to automatically update itself
14+
# update_fastlane
15+
16+
default_platform(:android)
17+
18+
platform :android do
19+
20+
desc "Increase the version code"
21+
lane :bump_version_code do
22+
path = '../app/build.gradle'
23+
re = /versionCode\s+(\d+)/
24+
25+
s = File.read(path)
26+
versionCode = s[re, 1].to_i
27+
s[re, 1] = (versionCode + 1).to_s
28+
29+
f = File.new(path, 'w')
30+
f.write(s)
31+
f.close
32+
end
33+
34+
desc "Runs all the tests"
35+
lane :test do
36+
gradle(task: "test")
37+
end
38+
39+
desc "Create an apk"
40+
lane :build do
41+
gradle(
42+
task: "clean assembleRelease",
43+
print_command: false,
44+
properties: {
45+
"android.injected.signing.store.file" => ENV["ANDROID_KEYSTORE_FILE"],
46+
"android.injected.signing.store.password" => ENV["ANDROID_KEYSTORE_PASSWORD"],
47+
"android.injected.signing.key.alias" => ENV["ANDROID_KEY_ALIAS"],
48+
"android.injected.signing.key.password" => ENV["ANDROID_KEY_PASSWORD"],
49+
}
50+
)
51+
end
52+
53+
desc "Submit a new build to internal testing track"
54+
lane :beta do
55+
bump_version_code
56+
build
57+
upload_to_play_store(track: 'internal')
58+
end
59+
60+
desc "Deploy a new version to the Google Play"
61+
lane :deploy do
62+
gradle(task: "clean assembleRelease")
63+
upload_to_play_store
64+
end
65+
end

0 commit comments

Comments
 (0)