-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathorb.yml
238 lines (232 loc) · 7.85 KB
/
orb.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
version: 2.1
description: |
Build and publish hybrid Apps for iOS / Android
Repository: https://github.com/okode/orbs
orbs:
common: okode/common@1
android: circleci/android@2
gradle: circleci/gradle@2
node: circleci/node@5
jobs:
ios:
parameters:
node-version:
type: string
default: '18'
cocoapods-version:
type: string
default: ''
fastlane-version:
type: string
default: ''
xcode-version:
type: string
default: '14.3.1'
ssh-permission-fingerprint:
type: string
default: ''
custom-npm-login:
type: boolean
default: false
pwa-path:
type: string
default: 'www'
executor:
name: common/node-mac-machine
xcode-version: << parameters.xcode-version >>
steps:
- checkout
- attach_workspace:
at: .
- when:
condition: << parameters.ssh-permission-fingerprint >>
steps:
- add_ssh_keys:
fingerprints:
- '<< parameters.ssh-permission-fingerprint >>'
- when:
condition: << parameters.node-version >>
steps:
- node/install:
node-version: << parameters.node-version >>
- when:
condition: << parameters.custom-npm-login >>
steps:
- common/custom-npm-login
- node/install-packages:
cache-version: v3-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- install-ios:
cocoapods-version: << parameters.cocoapods-version >>
fastlane-version: << parameters.fastlane-version >>
- run:
name: Syncing Capacitor project
command: npx cap sync ios
- run:
name: Building
command: |
if [[ $CIRCLE_TAG = *-dist ]]; then
export BUILD_TYPE=release
export MATCH_PASSWORD=$MATCH_PASSWORD_DIST
else
export BUILD_TYPE=beta
fi
bundle install && bundle exec fastlane ${CIRCLE_JOB} ${BUILD_TYPE} distribute:true
no_output_timeout: 30m
- persist_to_workspace:
root: .
paths:
- artifacts/*.ipa
- common/notify
android:
parameters:
node-version:
type: string
default: '18'
key-name:
type: string
default: android-release.keystore
dist-certs-repo-url:
type: string
default: ''
ssh-permission-fingerprint:
type: string
default: ''
custom-npm-login:
type: boolean
default: false
pwa-path:
type: string
default: 'www'
android-docker-tag:
type: string
default: '2023.08.1-node'
build-tools-version:
type: string
default: ''
resource-class:
type: string
default: medium
resource_class: << parameters.resource-class >>
executor:
name: android/android-docker
tag: << parameters.android-docker-tag >>
steps:
- checkout
- attach_workspace:
at: .
- when:
condition: << parameters.build-tools-version >>
steps:
- run:
name: Installing required Android Build Tools version
command: |
BUILD_TOOLS_VERSION=$(sdkmanager --list_installed | grep -e "build-tools" | grep -Po "(?<=\|).*?(?=\|)" | head -n 1 | xargs)
sdkmanager --uninstall "build-tools;$BUILD_TOOLS_VERSION"
sdkmanager --install "build-tools;<< parameters.build-tools-version >>"
- run:
name: Fix Android build-tools installation
shell: /bin/bash
command: |
if [ -z "<< parameters.build-tools-version >>" ]; then
BUILD_TOOLS_VERSION=$(sdkmanager --list_installed | grep -e "build-tools" | grep -Po "(?<=\|).*?(?=\|)" | head -n 1 | xargs)
BUILD_TOOLS_VERSION=$(echo "$BUILD_TOOLS_VERSION" | tr ' ' '-')
else
BUILD_TOOLS_VERSION=<< parameters.build-tools-version >>
fi
cp /home/circleci/android-sdk/build-tools/$BUILD_TOOLS_VERSION/d8 /home/circleci/android-sdk/build-tools/$BUILD_TOOLS_VERSION/dx
cp /home/circleci/android-sdk/build-tools/$BUILD_TOOLS_VERSION/lib/d8.jar /home/circleci/android-sdk/build-tools/$BUILD_TOOLS_VERSION/lib/dx.jar
- run:
name: Fix Ruby Gems permissions
command: sudo chown -R $(whoami) /var/lib/gems && sudo chown -R $(whoami) /usr/local/bin
- node/install:
node-version: << parameters.node-version >>
- when:
condition: << parameters.custom-npm-login >>
steps:
- common/custom-npm-login
- node/install-packages:
cache-version: v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- run:
name: Installing Fastlane
command: sudo gem install fastlane -NV
- common/keystores:
dist-certs-repo-url: << parameters.dist-certs-repo-url >>
ssh-permission-fingerprint: << parameters.ssh-permission-fingerprint >>
key-name: << parameters.key-name >>
- run:
name: Syncing Capacitor project
command: npx cap sync android
- gradle/with_cache:
steps:
- run:
name: Building
command: |
if [[ $CIRCLE_TAG = *-dist ]]; then
export BUILD_TYPE=release
echo "export GOOGLE_APPLICATION_CREDENTIALS=$(mktemp)" >> $BASH_ENV
source $BASH_ENV
GOOGLE_APPLICATION_CREDENTIALS_JSON=$(echo $GOOGLE_APPLICATION_CREDENTIALS_B64 | base64 --decode)
printf '%s\n' "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > $GOOGLE_APPLICATION_CREDENTIALS
echo "${GOOGLEPLAY_AUTH_JSON}" > gplay.json
else
export BUILD_TYPE=beta
fi
bundle install && bundle exec fastlane ${CIRCLE_JOB} ${BUILD_TYPE} distribute:true
no_output_timeout: 30m
- persist_to_workspace:
root: .
paths:
- artifacts/*.apk
- artifacts/*.aab
- common/notify
commands:
install-ios:
description: Install iOS requirements
parameters:
cocoapods-version:
type: string
default: ''
fastlane-version:
type: string
default: ''
steps:
- when:
condition:
and:
- not:
equal: [ 'latest', << parameters.cocoapods-version >> ]
- not:
equal: [ '', << parameters.cocoapods-version >> ]
steps:
- run:
name: Installing Cocoapods version << parameters.cocoapods-version >>
command: |
sudo gem install cocoapods -v << parameters.cocoapods-version >>
- when:
condition:
equal: [ 'latest', << parameters.cocoapods-version >> ]
steps:
- run:
name: Installing Cocoapods latest version
command: |
sudo gem install cocoapods
- when:
condition:
and:
- not:
equal: [ 'latest', << parameters.fastlane-version >> ]
- not:
equal: [ '', << parameters.fastlane-version >> ]
steps:
- run:
name: Installing Fastlane version << parameters.fastlane-version >>
command: |
sudo gem install fastlane -v << parameters.fastlane-version >>
- when:
condition:
equal: [ 'latest', << parameters.fastlane-version >> ]
steps:
- run:
name: Installing Fastlane latest version
command: |
sudo gem install fastlane