/
config.yml
190 lines (169 loc) · 4.47 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
version: 2.1
orbs:
react-native: react-native-community/react-native@7.4.0
executors:
android_executor:
parameters:
resource-class:
default: medium
type: string
working-directory:
default: ~/app
type: string
docker:
- image: cimg/android:2023.09.1-node
resource_class: <<parameters.resource-class>>
working_directory: <<parameters.working-directory>>
ios_executor:
parameters:
resource-class:
default: macos.x86.medium.gen2
type: string
working-directory:
default: ~/app
type: string
macos:
xcode: '15.0.0'
resource_class: <<parameters.resource-class>>
working_directory: <<parameters.working-directory>>
commands:
checkout_attach_workspace:
description: 'Checkout and attach workspace'
steps:
- checkout
- attach_workspace:
at: ~/app
jobs:
install_dependencies:
executor:
name: react-native/linux_js
node_version: '18.17.1'
working_directory: ~/app
steps:
- checkout
- react-native/yarn_install
- persist_to_workspace:
root: ~/app
paths:
- node_modules
lint:
executor: react-native/linux_js
working_directory: ~/app
steps:
- checkout_attach_workspace
- run:
name: Lint
command: yarn lint
validate_typescript:
executor: react-native/linux_js
working_directory: ~/app
steps:
- checkout_attach_workspace
- run:
name: Typescript
command: yarn typescript
android_build:
executor: android_executor
parameters:
project_path:
default: ./example/android
type: string
steps:
- checkout_attach_workspace
- react-native/yarn_install
- react-native/android_build:
project_path: <<parameters.project_path>>
- persist_to_workspace:
paths:
- <<parameters.project_path>>/app/build/outputs/apk
root: .
- store_artifacts:
path: <<parameters.project_path>>/app/build/outputs/apk
ios_build:
executor: ios_executor
parameters:
pod_install_directory:
default: ./example/ios
type: string
steps:
- checkout_attach_workspace
- react-native/setup_macos_executor:
node_version: '18.17.1'
android: false
detox: false
- react-native/yarn_install
- run:
name: Install Detox
command: npm install detox-cli --global
- restore_cache:
keys:
- >-
{{ .Environment.CACHE_VERSION }}-cache-pods-{{ checksum
"<<parameters.pod_install_directory>>/Podfile.lock" }}
- '{{ .Environment.CACHE_VERSION }}-cache-pods'
- run:
name: Install CocoaPods
command: cd ./example/ios && bundle install && bundle exec pod install && cd -
- save_cache:
key: >-
{{ .Environment.CACHE_VERSION }}-cache-pods-{{ checksum
"<<parameters.pod_install_directory>>/Podfile.lock" }}
paths:
- <<parameters.pod_install_directory>>/Pods
- react-native/ios_build:
project_path: ./example/ios/Example.xcworkspace
project_type: workspace
scheme: example
device: iPhone 15
publish_version:
executor:
name: react-native/linux_js
node_version: '18.17.1'
working_directory: ~/app
steps:
- checkout_attach_workspace
- run:
name: Publish New Version
command: yarn ci:publish
workflows:
build-lint-app:
jobs:
- install_dependencies:
filters:
branches:
ignore:
- main
- lint:
requires:
- install_dependencies
- validate_typescript:
requires:
- install_dependencies
- android_build:
filters:
branches:
ignore:
- main
requires:
- lint
- validate_typescript
- ios_build:
filters:
branches:
ignore:
- main
requires:
- lint
- validate_typescript
release:
jobs:
- install_dependencies:
filters:
branches:
only:
- main
- publish_version:
context:
- SHELL_VARIABLES
requires:
- install_dependencies