-
Notifications
You must be signed in to change notification settings - Fork 32
460 lines (427 loc) · 15.4 KB
/
build-android-toolchain.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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
name: Build Android Toolchain
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-icu-android:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- name: Cache ICU
id: cache-icu
uses: actions/cache@v2
with:
path: |
~/icu/build-aarch64-linux-android/lib
~/icu/build-armv7a-linux-androideabi/lib
~/icu/build-x86_64-linux-android/lib
~/icu/build-i686-linux-android/lib
key: icu-73-2
- name: Build ICU
if: steps.cache-icu.outputs.cache-hit != 'true'
run: ./build/Linux/010-build-icu.sh
- uses: actions/upload-artifact@v2
with:
name: icu-arm64-v8a
path: |
~/icu/build-aarch64-linux-android/lib
- uses: actions/upload-artifact@v2
with:
name: icu-armeabi-v7a
path: |
~/icu/build-armv7a-linux-androideabi/lib
- uses: actions/upload-artifact@v2
with:
name: icu-x86_64
path: |
~/icu/build-x86_64-linux-android/lib
- uses: actions/upload-artifact@v2
with:
name: icu-x86
path: |
~/icu/build-i686-linux-android/lib
build-swift-android-arm-64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Cache Swift Arm64
id: cache-swift-arm-64
uses: actions/cache@v2
with:
path: ~/out/swift-android-arm64-v8a.tar
key: ${{ runner.os }}-arm64-${{ hashFiles('.swift.sum') }}
- name: Build Swift
if: steps.cache-swift-arm-64.outputs.cache-hit != 'true'
run: ./build/Linux/031-build-swift-arm64.sh
- name: Clean sources
if: steps.cache-swift-arm-64.outputs.cache-hit != 'true'
run: rm -rf ~/swift-source
- name: Archive toolchain
if: steps.cache-swift-arm-64.outputs.cache-hit != 'true'
run: pushd ~/out; tar -cvf swift-android-arm64-v8a.tar swift-android; popd
- uses: actions/upload-artifact@v2
with:
name: swift-android-arm64-v8a
path: ~/out/swift-android-arm64-v8a.tar
build-swift-android-armeabi-v7a:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Cache Swift Arm 32
id: cache-swift-arm-32
uses: actions/cache@v2
with:
path: ~/out/swift-android-armeabi-v7a.tar
key: ${{ runner.os }}-arm32-${{ hashFiles('.swift.sum') }}
- name: Build Swift
if: steps.cache-swift-arm-32.outputs.cache-hit != 'true'
run: ./build/Linux/032-build-swift-arm.sh
- name: Clean sources
if: steps.cache-swift-arm-32.outputs.cache-hit != 'true'
run: rm -rf ~/swift-source
- name: Archive toolchain
if: steps.cache-swift-arm-32.outputs.cache-hit != 'true'
run: pushd ~/out; tar -cvf swift-android-armeabi-v7a.tar swift-android; popd
- uses: actions/upload-artifact@v2
with:
name: swift-android-armeabi-v7a
path: ~/out/swift-android-armeabi-v7a.tar
build-swift-android-x86:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Cache Swift x86
id: cache-swift-x86
uses: actions/cache@v2
with:
path: ~/out/swift-android-x86.tar
key: ${{ runner.os }}-x86-${{ hashFiles('.swift.sum') }}
- name: Build Swift
if: steps.cache-swift-x86.outputs.cache-hit != 'true'
run: ./build/Linux/034-build-swift-x86.sh
- name: Clean sources
if: steps.cache-swift-x86.outputs.cache-hit != 'true'
run: rm -rf ~/swift-source
- name: Archive toolchain
if: steps.cache-swift-x86.outputs.cache-hit != 'true'
run: pushd ~/out; tar -cvf swift-android-x86.tar swift-android; popd
- uses: actions/upload-artifact@v2
with:
name: swift-android-x86
path: ~/out/swift-android-x86.tar
build-swift-android-x86_64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Cache Swift x86_64
id: cache-swift-x86_64
uses: actions/cache@v2
with:
path: ~/out/swift-android-x86_64.tar
key: ${{ runner.os }}-x86_64-${{ hashFiles('.swift.sum') }}
- name: Build Swift
if: steps.cache-swift-x86_64.outputs.cache-hit != 'true'
run: ./build/Linux/033-build-swift-x86_64.sh
- name: Clean sources
if: steps.cache-swift-x86_64.outputs.cache-hit != 'true'
run: rm -rf ~/swift-source
- name: Archive toolchain
if: steps.cache-swift-x86_64.outputs.cache-hit != 'true'
run: pushd ~/out; tar -cvf swift-android-x86_64.tar swift-android; popd
- uses: actions/upload-artifact@v2
with:
name: swift-android-x86_64
path: ~/out/swift-android-x86_64.tar
build-foundation-dependecies-android:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- name: Cache foundation dependencies
id: cache-foundation-dependencies
uses: actions/cache@v2
with:
path: |
~/foundation-dependencies/arm64
~/foundation-dependencies/arm
~/foundation-dependencies/x86_64
~/foundation-dependencies/x86
key: openssl-1.1.1w-curl-7_88_1-libxmlv2.9.14
- name: Build Foundation Dependenncies
if: steps.cache-foundation-dependencies.outputs.cache-hit != 'true'
run: ./build/Linux/040-build-foundation-depends.sh
- uses: actions/upload-artifact@v2
with:
name: foundation-dependecies-arm64-v8a
path: |
~/foundation-dependencies/arm64
!~/foundation-dependencies/arm64/src
- uses: actions/upload-artifact@v2
with:
name: foundation-dependecies-armeabi-v7a
path: |
~/foundation-dependencies/arm
!~/foundation-dependencies/arm/src
- uses: actions/upload-artifact@v2
with:
name: foundation-dependecies-x86_64
path: |
~/foundation-dependencies/x86_64
!~/foundation-dependencies/x86_64/src
- uses: actions/upload-artifact@v2
with:
name: foundation-dependecies-x86
path: |
~/foundation-dependencies/x86
!~/foundation-dependencies/x86/src
build-swift-corelibs-android-arm-64:
needs: [build-icu-android, build-swift-android-arm-64, build-foundation-dependecies-android]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- uses: actions/download-artifact@v2
with:
name: icu-arm64-v8a
path: /home/runner/icu/build-aarch64-linux-android
- uses: actions/download-artifact@v2
with:
name: swift-android-arm64-v8a
path: ~/out
- name: Unarchive toolchain
run: pushd ~/out; tar -xvf swift-android-arm64-v8a.tar; popd
- uses: actions/download-artifact@v2
with:
name: foundation-dependecies-arm64-v8a
path: ~/foundation-dependencies/arm64
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Build Corelibs
run: ./build/Linux/052-build-corelibs.sh arm64 aarch64 aarch64-linux-android arm64-v8a aarch64-linux-android
- uses: actions/upload-artifact@v2
with:
name: swift-android-clang-libs
path: ~/out/swift-android/swift-nightly-install/usr/lib/clang
- uses: actions/upload-artifact@v2
with:
name: swift-android-arm64-v8a-libs
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-aarch64
build-swift-corelibs-android-armeabi-v7a:
needs: [build-icu-android, build-swift-android-armeabi-v7a, build-foundation-dependecies-android]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- uses: actions/download-artifact@v2
with:
name: icu-armeabi-v7a
path: /home/runner/icu/build-armv7a-linux-androideabi
- uses: actions/download-artifact@v2
with:
name: swift-android-armeabi-v7a
path: ~/out
- name: Unarchive toolchain
run: pushd ~/out; tar -xvf swift-android-armeabi-v7a.tar; popd
- uses: actions/download-artifact@v2
with:
name: foundation-dependecies-armeabi-v7a
path: ~/foundation-dependencies/arm
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Build Corelibs
run: ./build/Linux/052-build-corelibs.sh arm armv7 arm-linux-androideabi armeabi-v7a armv7a-linux-androideabi
- uses: actions/upload-artifact@v2
with:
name: swift-android-armeabi-v7a-libs
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-armv7
build-swift-corelibs-android-x86:
needs: [build-icu-android, build-swift-android-x86, build-foundation-dependecies-android]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- uses: actions/download-artifact@v2
with:
name: icu-x86
path: /home/runner/icu/build-i686-linux-android
- uses: actions/download-artifact@v2
with:
name: swift-android-x86
path: ~/out
- name: Unarchive toolchain
run: pushd ~/out; tar -xvf swift-android-x86.tar; popd
- uses: actions/download-artifact@v2
with:
name: foundation-dependecies-x86
path: ~/foundation-dependencies/x86
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Build Corelibs
run: ./build/Linux/052-build-corelibs.sh x86 i686 i686-linux-android x86 i686-linux-android
- uses: actions/upload-artifact@v2
with:
name: swift-android-x86-libs
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-i686
build-swift-corelibs-android-x86_64:
needs: [build-icu-android, build-swift-android-x86_64, build-foundation-dependecies-android]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo ./build/Linux/000-install-dependencies.sh
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- name: Define build folders
run: ./build/Linux/003-define-build-folders.sh
- uses: actions/download-artifact@v2
with:
name: icu-x86_64
path: /home/runner/icu/build-x86_64-linux-android
- uses: actions/download-artifact@v2
with:
name: swift-android-x86_64
path: ~/out
- name: Unarchive toolchain
run: pushd ~/out; tar -xvf swift-android-x86_64.tar; popd
- uses: actions/download-artifact@v2
with:
name: foundation-dependecies-x86_64
path: ~/foundation-dependencies/x86_64
- name: Clone Swift
run: ./build/Linux/020-clone-swift.sh
- name: Build Corelibs
run: ./build/Linux/052-build-corelibs.sh x86_64 x86_64 x86_64-linux-android x86_64 x86_64-linux-android
- uses: actions/upload-artifact@v2
with:
name: swift-android-x86_64-libs
path: ~/out/swift-android/swift-nightly-install/usr/lib/swift-x86_64
build-swift-mac-x86_64:
runs-on: macos-12
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: ./build/macOS/000-install-dependencies.sh
- name: Clone Swift
run: ./build/macOS/010-clone-swift.sh
- name: Cache Swift Mac
id: cache-swift-mac
uses: actions/cache@v2
with:
path: ~/swift-android-bin.tar
key: ${{ runner.os }}-x86_64-${{ hashFiles('.swift.sum') }}
- name: Build Swift
if: steps.cache-swift-mac.outputs.cache-hit != 'true'
run: ./build/macOS/020-build-swift.sh
- name: Build Swift PM
if: steps.cache-swift-mac.outputs.cache-hit != 'true'
run: ./build/macOS/030-build-swiftpm.sh
- name: Collect toolchain bin
if: steps.cache-swift-mac.outputs.cache-hit != 'true'
run: ./build/macOS/040-collect-toolchain-bin.sh
- uses: actions/upload-artifact@v2
with:
name: swift-android-bin
path: ~/swift-android-bin.tar
collect-mac-x86_64-toolchain:
needs: [build-swift-mac-x86_64, build-swift-corelibs-android-arm-64, build-swift-corelibs-android-armeabi-v7a, build-swift-corelibs-android-x86_64, build-swift-corelibs-android-x86]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Install NDK
run: ./build/Linux/002-install-ndk.sh
- uses: actions/download-artifact@v2
with:
name: swift-android-bin
path: ~/
- name: Unarchive bin
run: pushd ~/; tar -xvf swift-android-bin.tar; popd
- uses: actions/download-artifact@v2
with:
name: swift-android-arm64-v8a-libs
path: ~/lib/swift-aarch64
- uses: actions/download-artifact@v2
with:
name: swift-android-armeabi-v7a-libs
path: ~/lib/swift-armv7
- uses: actions/download-artifact@v2
with:
name: swift-android-x86_64-libs
path: ~/lib/swift-x86_64
- uses: actions/download-artifact@v2
with:
name: swift-android-x86-libs
path: ~/lib/swift-i686
- uses: actions/download-artifact@v2
with:
name: swift-android-clang-libs
path: ~/lib/clang
- name: Collect toolchain
run: ./build/Linux/060-collect-toolchain.sh
- uses: actions/upload-artifact@v2
with:
name: swift-android
path: ~/out/swift-android.zip