This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
config.yml
266 lines (248 loc) · 7.46 KB
/
config.yml
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
version: 2.1
executors:
js:
docker:
- image: circleci/node:12.13.1
working_directory: ~/expo-project
environment:
YARN_CACHE_FOLDER: ~/yarn_cache
android:
# WARNING: medium (default) seems not to be enough for Turtle
# To use larger resource classes you need to open a ticket and request it from CircleCI
# More Information Here - https://circleci.com/docs/2.0/configuration-reference/#resource_class
resource_class: xlarge
docker:
# https://github.com/expo/expo-turtle-android
- image: dsokal/expo-turtle-android
# NOTE: If you have macos machines you can use them instead.
# Comment out 'resource_class', 'docker' and 'image' and replace
# with the comments below.
# macos:
# xcode: 10.1.0
working_directory: ~/expo-project
environment:
EXPO_SDK_VERSION: 39.0.0
TURTLE_VERSION: 0.28.1
PLATFORM: android
YARN_CACHE_FOLDER: ~/yarn_cache
ios:
macos:
xcode: 11.1.0
working_directory: ~/expo-project
environment:
EXPO_SDK_VERSION: 39.0.0
TURTLE_VERSION: 0.28.1
PLATFORM: ios
YARN_CACHE_FOLDER: /Users/distiller/yarn_cache
HOMEBREW_NO_AUTO_UPDATE: 1
commands:
install_macos_deps:
steps:
- run:
name: Installing jq & node@12
command: |
brew install jq node@12
brew link --overwrite --force node@12
add_yarn_binaries_to_path:
steps:
- run:
name: Add yarn binaries path to $PATH
command: echo 'export PATH=~/.yarn/bin:$PATH' >> $BASH_ENV
determine_turtle_cache_key_component:
steps:
- run:
name: Determine Turtle cache key component
command: echo $TURTLE_VERSION $PLATFORM > /tmp/turtle-version-platform
restore_turtle_cache:
steps:
- restore_cache:
keys:
- cache-turtle-cli-{{ checksum "/tmp/turtle-version-platform" }}
save_turtle_cache:
steps:
- save_cache:
paths:
- ~/.turtle
- ~/yarn_cache
key: cache-turtle-cli-{{ checksum "/tmp/turtle-version-platform" }}
install_turtle_ios:
steps:
- run:
name: Installing turtle-cli
command: |
yarn config set prefix ~/.yarn
yarn global add turtle-cli@$TURTLE_VERSION
setup_turtle:
steps:
- run:
name: Setting up environment for Turtle
command: turtle setup:$PLATFORM --sdk-version $EXPO_SDK_VERSION
restore_yarn_cache:
parameters:
platform:
type: string
steps:
- restore_cache:
keys:
- cache-yarn-<< parameters.platform >>-{{ checksum "package.json" }}
save_yarn_cache:
parameters:
platform:
type: string
steps:
- save_cache:
paths:
- ~/yarn_cache
key: cache-yarn-<< parameters.platform >>-{{ checksum "package.json" }}
workflows:
version: 2
builds:
jobs:
- publish_app:
filters:
branches:
only: master
- build_ios_simulator:
requires:
- publish_app
- build_ios_archive:
requires:
- publish_app
- build_android_apk:
requires:
- publish_app
- build_android_aab:
requires:
- publish_app
jobs:
publish_app:
executor: js
steps:
- checkout
- add_yarn_binaries_to_path
- restore_yarn_cache:
platform: linux
- run:
name: Installing expo-cli
command: yarn global add expo-cli
- run:
name: Publishing Expo app
command: |
expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD --non-interactive
yarn
expo publish
- save_yarn_cache:
platform: linux
build_ios_archive:
executor: ios
steps:
- checkout
- restore_yarn_cache:
platform: darwin
- run: yarn
- save_yarn_cache:
platform: darwin
- install_macos_deps
- add_yarn_binaries_to_path
- determine_turtle_cache_key_component
- restore_turtle_cache
- install_turtle_ios
- setup_turtle
- save_turtle_cache
- run:
name: Building Expo standalone app
command: |
echo $EXPO_IOS_DIST_P12_BASE64 > expo-project_dist.p12.base64
base64 --decode expo-project_dist.p12.base64 > expo-project_dist.p12
echo $EXPO_IOS_PROVISIONING_PROFILE_BASE64 > expo-project.mobileprovision.base64
base64 --decode expo-project.mobileprovision.base64 > expo-project.mobileprovision
turtle build:ios \
--team-id $EXPO_APPLE_TEAM_ID \
--dist-p12-path ./expo-project_dist.p12 \
--provisioning-profile-path ./expo-project.mobileprovision \
-o ~/expo-project.ipa
- store_artifacts:
path: ~/expo-project.ipa
build_ios_simulator:
executor: ios
steps:
- checkout
- restore_yarn_cache:
platform: darwin
- run: yarn
- save_yarn_cache:
platform: darwin
- install_macos_deps
- add_yarn_binaries_to_path
- determine_turtle_cache_key_component
- restore_turtle_cache
- install_turtle_ios
- setup_turtle
- save_turtle_cache
- run:
name: Building Expo standalone app
command: |
turtle build:ios \
--team-id $EXPO_APPLE_TEAM_ID \
--type simulator \
-o ~/expo-project.tar.gz
- store_artifacts:
path: ~/expo-project.tar.gz
build_android_apk:
executor: android
steps:
- checkout
- restore_yarn_cache:
platform: linux
- run: yarn
- save_yarn_cache:
platform: linux
- add_yarn_binaries_to_path
- determine_turtle_cache_key_component
- restore_turtle_cache
- run:
name: Installing gulp-cli & turtle-cli
command: yarn global add gulp-cli turtle-cli@$TURTLE_VERSION
- setup_turtle
- save_turtle_cache
- run:
name: Building Expo standalone app
command: |
echo $EXPO_ANDROID_KEYSTORE_BASE64 > expo-project.jks.base64
base64 --decode expo-project.jks.base64 > expo-project.jks
turtle build:android \
--keystore-path ./expo-project.jks \
--keystore-alias $EXPO_ANDROID_KEYSTORE_ALIAS \
--type apk \
-o ~/expo-project.apk
- store_artifacts:
path: ~/expo-project.apk
build_android_aab:
executor: android
steps:
- checkout
- restore_yarn_cache:
platform: linux
- run: yarn
- save_yarn_cache:
platform: linux
- add_yarn_binaries_to_path
- determine_turtle_cache_key_component
- restore_turtle_cache
- run:
name: Installing gulp-cli & turtle-cli
command: yarn global add gulp-cli turtle-cli@$TURTLE_VERSION
- setup_turtle
- save_turtle_cache
- run:
name: Building Expo standalone app
command: |
echo $EXPO_ANDROID_KEYSTORE_BASE64 > expo-project.jks.base64
base64 --decode expo-project.jks.base64 > expo-project.jks
turtle build:android \
--keystore-path ./expo-project.jks \
--keystore-alias $EXPO_ANDROID_KEYSTORE_ALIAS \
--type app-bundle \
-o ~/expo-project.aab
- store_artifacts:
path: ~/expo-project.aab