-
Notifications
You must be signed in to change notification settings - Fork 82
239 lines (203 loc) · 7.52 KB
/
cd.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
name: Mobile CD
on:
# Allows you to run this workflow manually from the Actions a tab
workflow_dispatch:
jobs:
ios-testflight-build:
name: ios-testflight-build
strategy:
matrix:
os: [macos-13]
node-version: [18.18.0]
ruby-version: [2.7]
xcode: [15.0.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout to git repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: ${{ matrix.node-version }}
- name: Install yarn dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: yarn
- name: Set up Ruby and Gemfile dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: './packages/mobile'
- name: Cache Pods directory
uses: actions/cache@v3
with:
path: ./packages/mobile/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install pods dependencies
working-directory: './packages/mobile/ios'
run: bundle exec pod install
- name: Decode signing certificate into a file
working-directory: './packages/mobile/ios'
env:
CERTIFICATE_BASE64: ${{ secrets.IOS_DIST_SIGNING_KEY }}
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > signing-cert.p12
- name: Build & upload iOS binary
working-directory: './packages/mobile/ios'
run: bundle exec fastlane ios beta
env:
X_CODE: ${{ matrix.xcode }}
DEVELOPER_APP_IDENTIFIER: ${{ secrets.DEVELOPER_APP_IDENTIFIER }}
DEVELOPER_TEAM_ID: ${{ secrets.DEVELOPER_TEAM_ID }}
ASC_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
ASC_KEY: ${{ secrets.APPLE_KEY_CONTENT }}
SIGNING_KEY_PASSWORD: ${{ secrets.IOS_DIST_SIGNING_KEY_PASSWORD }}
SIGNING_KEY_FILE_PATH: signing-cert.p12
- name: Upload logs to artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: gum-logs
path: /Users/runner/Library/Logs/gym/ton_keeper-ton_keeper.log
- name: Upload app-store ipa and dsyms to artifacts
uses: actions/upload-artifact@v3
with:
name: Tonkeeper ipa & dsyms ${{ env.VERSION_CODE }}
path: |
./packages/mobile/ios/ton_keeper.ipa
./packages/mobile/ios/*.app.dSYM.zip
android-store-build:
name: android-store-build
strategy:
matrix:
os: [macos-13]
node-version: [18.18.0]
ruby-version: [2.7]
java-version: [11.0.12]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout to git repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: ${{ matrix.node-version }}
- name: Install yarn dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: yarn
- name: Set up Ruby and Gemfile dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: './packages/mobile'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Decode signing certificate into a file
working-directory: './packages/mobile/android/app'
env:
CERTIFICATE_BASE64: ${{ secrets.ANDROID_DIST_SIGNING_KEY }}
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > google-release.keystore
- name: Decode service account into a file
working-directory: './packages/mobile/android'
env:
CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }}
run: |
echo $CREDENTIALS > service-account.json
- name: Patch for Google Play (remove REQUEST_INSTALL_PACKAGES)
run: |
git apply ./patches/google-play-release.patch
- name: Build & deploy Android release
working-directory: './packages/mobile/android'
run: bundle exec fastlane android beta
env:
KEYSTORE_FILE: ${{ github.workspace }}/packages/mobile/android/app/google-release.keystore
KEYSTORE_PASSWORD: ${{ secrets.TONKEEPER_UPLOAD_STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.TONKEEPER_UPLOAD_KEY_ALIAS}}
KEY_PASSWORD: ${{ secrets.TONKEEPER_UPLOAD_KEY_PASSWORD }}
ANDROID_JSON_KEY_FILE: service-account.json
- name: Upload android google play release to artifacts
uses: actions/upload-artifact@v3
with:
name: Tonkeeper aab ${{ env.VERSION_CODE }}
path: |
${{ github.workspace }}/packages/mobile/android/app/build/outputs
android-site-build:
name: android-site-build
strategy:
matrix:
os: [macos-13]
node-version: [18.18.0]
ruby-version: [2.7]
java-version: [11.0.12]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout to git repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: ${{ matrix.node-version }}
- name: Install yarn dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: yarn
- name: Set up Ruby and Gemfile dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: './packages/mobile'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Update ENVFILE for site
working-directory: './packages/mobile'
run: cp .env.site .env
- name: Decode signing certificate into a file
working-directory: './packages/mobile/android/app'
env:
CERTIFICATE_BASE64: ${{ secrets.ANDROID_DIST_SIGNING_KEY }}
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > google-release.keystore
- name: Decode service account into a file
working-directory: './packages/mobile/android'
env:
CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }}
run: |
echo $CREDENTIALS > service-account.json
- name: Build android apk
working-directory: './packages/mobile/android'
run: bundle exec fastlane android apk
env:
KEYSTORE_FILE: ${{ github.workspace }}/packages/mobile/android/app/google-release.keystore
KEYSTORE_PASSWORD: ${{ secrets.TONKEEPER_UPLOAD_STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.TONKEEPER_UPLOAD_KEY_ALIAS}}
KEY_PASSWORD: ${{ secrets.TONKEEPER_UPLOAD_KEY_PASSWORD }}
ANDROID_JSON_KEY_FILE: service-account.json
- name: Upload android apk to artifacts
uses: actions/upload-artifact@v3
with:
name: Tonkeeper apk ${{ env.VERSION_CODE }}
path: |
${{ github.workspace }}/packages/mobile/android/app/build/outputs