Skip to content

Commit 6e31336

Browse files
authored
Use fastlane to build and distribute iOS app #349
ref DEV-2149
2 parents 28c7830 + 0c0d6de commit 6e31336

File tree

15 files changed

+809
-969
lines changed

15 files changed

+809
-969
lines changed

.github/workflows/ci.yaml

Lines changed: 80 additions & 201 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ xcuserdata/
1515
xcshareddata/
1616
temp/
1717

18+
build/
19+
1820
# Ruby
1921
vendor/bundle/
22+
23+
# fastlane
24+
/fastlane/README.md
25+
/fastlane/report.xml

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
## NOTE(louis): This Gemfile is intended for the whole project, except ./example/reactnative
2-
3-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
42

53
# Ruby 3.3 is the default.
64
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
75
# https://github.com/actions/runner-images/issues/11345
86
ruby "~> 3.3"
97

10-
gem 'cocoapods', '~> 1.16'
8+
gem "cocoapods", "~> 1.16"
9+
gem "fastlane", "~> 2.227"

Gemfile.lock

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,26 @@ GEM
2222
algoliasearch (1.27.5)
2323
httpclient (~> 2.8, >= 2.8.3)
2424
json (>= 1.5.1)
25+
artifactory (3.0.17)
2526
atomos (0.1.3)
27+
aws-eventstream (1.3.2)
28+
aws-partitions (1.1070.0)
29+
aws-sdk-core (3.220.1)
30+
aws-eventstream (~> 1, >= 1.3.0)
31+
aws-partitions (~> 1, >= 1.992.0)
32+
aws-sigv4 (~> 1.9)
33+
base64
34+
jmespath (~> 1, >= 1.6.1)
35+
aws-sdk-kms (1.99.0)
36+
aws-sdk-core (~> 3, >= 3.216.0)
37+
aws-sigv4 (~> 1.5)
38+
aws-sdk-s3 (1.182.0)
39+
aws-sdk-core (~> 3, >= 3.216.0)
40+
aws-sdk-kms (~> 1)
41+
aws-sigv4 (~> 1.5)
42+
aws-sigv4 (1.11.0)
43+
aws-eventstream (~> 1, >= 1.0.2)
44+
babosa (1.0.4)
2645
base64 (0.2.0)
2746
benchmark (0.4.0)
2847
bigdecimal (3.1.9)
@@ -64,13 +83,96 @@ GEM
6483
nap (>= 0.8, < 2.0)
6584
netrc (~> 0.11)
6685
cocoapods-try (1.2.0)
86+
colored (1.2)
6787
colored2 (3.1.2)
88+
commander (4.6.0)
89+
highline (~> 2.0.0)
6890
concurrent-ruby (1.3.5)
6991
connection_pool (2.5.0)
92+
declarative (0.0.20)
93+
digest-crc (0.7.0)
94+
rake (>= 12.0.0, < 14.0.0)
95+
domain_name (0.6.20240107)
96+
dotenv (2.8.1)
7097
drb (2.2.1)
98+
emoji_regex (3.2.3)
7199
escape (0.0.4)
72100
ethon (0.16.0)
73101
ffi (>= 1.15.0)
102+
excon (0.112.0)
103+
faraday (1.10.4)
104+
faraday-em_http (~> 1.0)
105+
faraday-em_synchrony (~> 1.0)
106+
faraday-excon (~> 1.1)
107+
faraday-httpclient (~> 1.0)
108+
faraday-multipart (~> 1.0)
109+
faraday-net_http (~> 1.0)
110+
faraday-net_http_persistent (~> 1.0)
111+
faraday-patron (~> 1.0)
112+
faraday-rack (~> 1.0)
113+
faraday-retry (~> 1.0)
114+
ruby2_keywords (>= 0.0.4)
115+
faraday-cookie_jar (0.0.7)
116+
faraday (>= 0.8.0)
117+
http-cookie (~> 1.0.0)
118+
faraday-em_http (1.0.0)
119+
faraday-em_synchrony (1.0.0)
120+
faraday-excon (1.1.0)
121+
faraday-httpclient (1.0.1)
122+
faraday-multipart (1.1.0)
123+
multipart-post (~> 2.0)
124+
faraday-net_http (1.0.2)
125+
faraday-net_http_persistent (1.2.0)
126+
faraday-patron (1.0.0)
127+
faraday-rack (1.0.0)
128+
faraday-retry (1.0.3)
129+
faraday_middleware (1.2.1)
130+
faraday (~> 1.0)
131+
fastimage (2.4.0)
132+
fastlane (2.227.0)
133+
CFPropertyList (>= 2.3, < 4.0.0)
134+
addressable (>= 2.8, < 3.0.0)
135+
artifactory (~> 3.0)
136+
aws-sdk-s3 (~> 1.0)
137+
babosa (>= 1.0.3, < 2.0.0)
138+
bundler (>= 1.12.0, < 3.0.0)
139+
colored (~> 1.2)
140+
commander (~> 4.6)
141+
dotenv (>= 2.1.1, < 3.0.0)
142+
emoji_regex (>= 0.1, < 4.0)
143+
excon (>= 0.71.0, < 1.0.0)
144+
faraday (~> 1.0)
145+
faraday-cookie_jar (~> 0.0.6)
146+
faraday_middleware (~> 1.0)
147+
fastimage (>= 2.1.0, < 3.0.0)
148+
fastlane-sirp (>= 1.0.0)
149+
gh_inspector (>= 1.1.2, < 2.0.0)
150+
google-apis-androidpublisher_v3 (~> 0.3)
151+
google-apis-playcustomapp_v1 (~> 0.1)
152+
google-cloud-env (>= 1.6.0, < 2.0.0)
153+
google-cloud-storage (~> 1.31)
154+
highline (~> 2.0)
155+
http-cookie (~> 1.0.5)
156+
json (< 3.0.0)
157+
jwt (>= 2.1.0, < 3)
158+
mini_magick (>= 4.9.4, < 5.0.0)
159+
multipart-post (>= 2.0.0, < 3.0.0)
160+
naturally (~> 2.2)
161+
optparse (>= 0.1.1, < 1.0.0)
162+
plist (>= 3.1.0, < 4.0.0)
163+
rubyzip (>= 2.0.0, < 3.0.0)
164+
security (= 0.1.5)
165+
simctl (~> 1.6.3)
166+
terminal-notifier (>= 2.0.0, < 3.0.0)
167+
terminal-table (~> 3)
168+
tty-screen (>= 0.6.3, < 1.0.0)
169+
tty-spinner (>= 0.8.0, < 1.0.0)
170+
word_wrap (~> 1.0.0)
171+
xcodeproj (>= 1.13.0, < 2.0.0)
172+
xcpretty (~> 0.4.0)
173+
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
174+
fastlane-sirp (1.0.0)
175+
sysrandom (~> 1.0)
74176
ffi (1.17.1)
75177
ffi (1.17.1-aarch64-linux-gnu)
76178
ffi (1.17.1-aarch64-linux-musl)
@@ -85,34 +187,118 @@ GEM
85187
fourflusher (2.3.1)
86188
fuzzy_match (2.0.4)
87189
gh_inspector (1.1.3)
190+
google-apis-androidpublisher_v3 (0.54.0)
191+
google-apis-core (>= 0.11.0, < 2.a)
192+
google-apis-core (0.11.3)
193+
addressable (~> 2.5, >= 2.5.1)
194+
googleauth (>= 0.16.2, < 2.a)
195+
httpclient (>= 2.8.1, < 3.a)
196+
mini_mime (~> 1.0)
197+
representable (~> 3.0)
198+
retriable (>= 2.0, < 4.a)
199+
rexml
200+
google-apis-iamcredentials_v1 (0.17.0)
201+
google-apis-core (>= 0.11.0, < 2.a)
202+
google-apis-playcustomapp_v1 (0.13.0)
203+
google-apis-core (>= 0.11.0, < 2.a)
204+
google-apis-storage_v1 (0.31.0)
205+
google-apis-core (>= 0.11.0, < 2.a)
206+
google-cloud-core (1.8.0)
207+
google-cloud-env (>= 1.0, < 3.a)
208+
google-cloud-errors (~> 1.0)
209+
google-cloud-env (1.6.0)
210+
faraday (>= 0.17.3, < 3.0)
211+
google-cloud-errors (1.5.0)
212+
google-cloud-storage (1.47.0)
213+
addressable (~> 2.8)
214+
digest-crc (~> 0.4)
215+
google-apis-iamcredentials_v1 (~> 0.1)
216+
google-apis-storage_v1 (~> 0.31.0)
217+
google-cloud-core (~> 1.6)
218+
googleauth (>= 0.16.2, < 2.a)
219+
mini_mime (~> 1.0)
220+
googleauth (1.8.1)
221+
faraday (>= 0.17.3, < 3.a)
222+
jwt (>= 1.4, < 3.0)
223+
multi_json (~> 1.11)
224+
os (>= 0.9, < 2.0)
225+
signet (>= 0.16, < 2.a)
226+
highline (2.0.3)
227+
http-cookie (1.0.8)
228+
domain_name (~> 0.5)
88229
httpclient (2.9.0)
89230
mutex_m
90231
i18n (1.14.7)
91232
concurrent-ruby (~> 1.0)
233+
jmespath (1.6.2)
92234
json (2.10.1)
235+
jwt (2.10.1)
236+
base64
93237
logger (1.6.6)
238+
mini_magick (4.13.2)
239+
mini_mime (1.1.5)
94240
minitest (5.25.4)
95241
molinillo (0.8.0)
242+
multi_json (1.15.0)
243+
multipart-post (2.4.1)
96244
mutex_m (0.3.0)
97245
nanaimo (0.4.0)
98246
nap (1.1.0)
247+
naturally (2.2.1)
99248
netrc (0.11.0)
100249
nkf (0.2.0)
250+
optparse (0.6.0)
251+
os (1.1.4)
252+
plist (3.7.2)
101253
public_suffix (4.0.7)
254+
rake (13.2.1)
255+
representable (3.2.0)
256+
declarative (< 0.1.0)
257+
trailblazer-option (>= 0.1.1, < 0.2.0)
258+
uber (< 0.2.0)
259+
retriable (3.1.2)
102260
rexml (3.4.1)
261+
rouge (3.28.0)
103262
ruby-macho (2.5.1)
263+
ruby2_keywords (0.0.5)
264+
rubyzip (2.4.1)
104265
securerandom (0.4.1)
266+
security (0.1.5)
267+
signet (0.19.0)
268+
addressable (~> 2.8)
269+
faraday (>= 0.17.5, < 3.a)
270+
jwt (>= 1.5, < 3.0)
271+
multi_json (~> 1.10)
272+
simctl (1.6.10)
273+
CFPropertyList
274+
naturally
275+
sysrandom (1.0.5)
276+
terminal-notifier (2.0.0)
277+
terminal-table (3.0.2)
278+
unicode-display_width (>= 1.1.1, < 3)
279+
trailblazer-option (0.1.2)
280+
tty-cursor (0.7.1)
281+
tty-screen (0.8.2)
282+
tty-spinner (0.9.3)
283+
tty-cursor (~> 0.7)
105284
typhoeus (1.4.1)
106285
ethon (>= 0.9.0)
107286
tzinfo (2.0.6)
108287
concurrent-ruby (~> 1.0)
288+
uber (0.1.0)
289+
unicode-display_width (2.6.0)
290+
word_wrap (1.0.0)
109291
xcodeproj (1.27.0)
110292
CFPropertyList (>= 2.3.3, < 4.0)
111293
atomos (~> 0.1.3)
112294
claide (>= 1.0.2, < 2.0)
113295
colored2 (~> 3.1)
114296
nanaimo (~> 0.4.0)
115297
rexml (>= 3.3.6, < 4.0)
298+
xcpretty (0.4.0)
299+
rouge (~> 3.28.0)
300+
xcpretty-travis-formatter (1.0.1)
301+
xcpretty (~> 0.2, >= 0.0.7)
116302

117303
PLATFORMS
118304
aarch64-linux-gnu
@@ -129,6 +315,7 @@ PLATFORMS
129315

130316
DEPENDENCIES
131317
cocoapods (~> 1.16)
318+
fastlane (~> 2.227)
132319

133320
RUBY VERSION
134321
ruby 3.3.6p108

Makefile

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,105 @@ build-image:
6565
.PHONY: push-image
6666
push-image:
6767
docker push $(IMAGE)
68+
69+
.PHONY: clean
70+
clean:
71+
rm -rf ./build
72+
73+
.PHONY: sdk-build
74+
sdk-build:
75+
npm ci
76+
npm run build
77+
78+
.PHONY: react-native-npm-ci
79+
react-native-npm-ci:
80+
cd ./example/reactnative; \
81+
rm -rf node_modules; \
82+
yarn install --frozen-lockfile
83+
84+
.PHONY: react-native-set-versionCode
85+
react-native-set-versionCode:
86+
/usr/bin/sed -I "" "s/versionCode 1/versionCode $(shell date +%s)/" ./example/reactnative/android/app/build.gradle
87+
88+
.PHONY: react-native-build-unsigned-apk
89+
react-native-build-unsigned-apk:
90+
cd ./example/reactnative/android; \
91+
./gradlew :app:assembleRelease
92+
93+
.PHONY: react-native-zipalign
94+
react-native-zipalign:
95+
"$(ANDROID_HOME)/build-tools/33.0.3/zipalign" -c -v 4 ./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk
96+
97+
.PHONY: react-native-apksigner
98+
react-native-apksigner:
99+
"$(ANDROID_HOME)/build-tools/33.0.3/apksigner" sign \
100+
--ks $(ANDROID_KEYSTORE_PATH) \
101+
--ks-key-alias $(ANDROID_KEY_ALIAS) \
102+
--ks-pass pass:$(ANDROID_KEYSTORE_PASSWORD) \
103+
--key-pass pass:$(ANDROID_KEY_PASSWORD) \
104+
--out ./example/reactnative/android/app/build/outputs/apk/release/app-release-signed.apk \
105+
./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk
106+
107+
.PHONY: react-native-pod-install
108+
react-native-pod-install:
109+
cd ./example/reactnative/ios; bundle exec pod install
110+
111+
.PHONY: react-native-build-ios-app
112+
react-native-build-ios-app:
113+
bundle exec fastlane react_native_build_ios_app CURRENT_PROJECT_VERSION:$(shell date +%s)
114+
115+
.PHONY: react-native-upload-ios-app
116+
react-native-upload-ios-app:
117+
bundle exec fastlane upload_ios_app ipa:./build/Release/iOS/reactNativeExample/reactNativeExample.ipa
118+
119+
.PHONY: capacitor-npm-ci
120+
capacitor-npm-ci:
121+
cd ./example/capacitor; \
122+
npm ci
123+
124+
.PHONY: capacitor-npm-audit
125+
capacitor-npm-audit:
126+
cd ./example/capacitor; \
127+
npm audit
128+
129+
# npx cap sync runs `bundle exec pod install` under the hood.
130+
.PHONY: capacitor-build-js
131+
capacitor-build-js:
132+
cd ./example/capacitor; \
133+
npm run build; \
134+
npx cap sync
135+
136+
.PHONY: capacitor-build-ios-simulator
137+
capacitor-build-ios-simulator:
138+
bundle exec fastlane capacitor_build_ios_simulator
139+
140+
.PHONY: capacitor-build-ios-app
141+
capacitor-build-ios-app:
142+
bundle exec fastlane capacitor_build_ios_app CURRENT_PROJECT_VERSION:$(shell date +%s)
143+
144+
.PHONY: capacitor-upload-ios-app
145+
capacitor-upload-ios-app:
146+
bundle exec fastlane upload_ios_app ipa:./build/Release/iOS/capacitor/capacitor.ipa
147+
148+
.PHONY: capacitor-build-unsigned-apk
149+
capacitor-build-unsigned-apk:
150+
cd ./example/capacitor/android; \
151+
./gradlew :app:assembleRelease
152+
153+
.PHONY: capacitor-set-versionCode
154+
capacitor-set-versionCode:
155+
/usr/bin/sed -I "" "s/versionCode 1/versionCode $(shell date +%s)/" ./example/capacitor/android/app/build.gradle
156+
157+
.PHONY: capacitor-zipalign
158+
capacitor-zipalign:
159+
"$(ANDROID_HOME)/build-tools/35.0.1/zipalign" -c -v 4 ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk
160+
161+
.PHONY: capacitor-apksigner
162+
capacitor-apksigner:
163+
"$(ANDROID_HOME)/build-tools/35.0.1/apksigner" sign \
164+
--ks $(ANDROID_KEYSTORE_PATH) \
165+
--ks-key-alias $(ANDROID_KEY_ALIAS) \
166+
--ks-pass pass:$(ANDROID_KEYSTORE_PASSWORD) \
167+
--key-pass pass:$(ANDROID_KEY_PASSWORD) \
168+
--out ./example/capacitor/android/app/build/outputs/apk/release/app-release-signed.apk \
169+
./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk

0 commit comments

Comments
 (0)