-
Notifications
You must be signed in to change notification settings - Fork 52
854 lines (803 loc) · 44.7 KB
/
build-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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
name: Development Snapshot
on:
workflow_dispatch:
inputs:
swift_version:
description: 'Swift Version'
default: '0.0.0'
required: false
type: string
android_api_level:
description: 'Android API Level'
default: 28
required: false
type: number
swift_tag:
description: 'Swift Build Tag'
required: false
type: string
debug_info:
description: 'Emit PDBs (Debug Info)'
default: false
type: boolean
signed:
description: 'Code Sign'
default: false
type: boolean
create_release:
description: 'Create Release'
type: boolean
default: true
required: false
create_snapshot:
description: 'Create Snapshot'
type: boolean
default: true
required: false
build_android:
description: 'Build Android SDK'
required: false
default: false
type: boolean
workflow_call:
inputs:
swift_version:
description: 'Swift Version'
default: '0.0.0'
required: false
type: string
android_api_level:
description: 'Android API Level'
default: 28
required: false
type: number
swift_tag:
description: 'Swift Build Tag'
required: false
type: string
debug_info:
description: 'Emit PDBs (Debug Info)'
default: true
type: boolean
signed:
description: 'Code Sign'
default: false
type: boolean
create_release:
description: 'Create Release'
type: boolean
default: true
required: false
create_snapshot:
description: 'Create Snapshot'
type: boolean
default: true
required: false
windows_x64_default_runner:
description: 'X64 Build runner'
required: false
type: string
windows_arm64_default_runner:
description: 'ARM64 Build runner'
required: false
type: string
windows_x64_compilers_runner:
description: 'X64 Build runner for `compilers` job'
required: false
type: string
windows_arm64_compilers_runner:
description: 'ARM64 Build runner for `compilers` job'
required: false
type: string
windows_build_arch:
description: 'Windows build architecture'
required: false
type: string
build_android:
description: 'Build Android SDK'
required: false
default: false
type: boolean
secrets:
SYMBOL_SERVER_PAT:
required: true
CERTIFICATE:
required: true
PASSPHRASE:
required: true
env:
SCCACHE_DIRECT: yes
jobs:
context:
runs-on: ubuntu-latest
outputs:
curl_revision: ${{ steps.context.outputs.curl_revision }}
curl_version: ${{ steps.context.outputs.curl_version }}
ds2_revision: ${{ steps.context.outputs.ds2_revision }}
indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }}
libxml2_revision: ${{ steps.context.outputs.libxml2_revision }}
libxml2_version: ${{ steps.context.outputs.libxml2_version }}
llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }}
mimalloc_revision: ${{ steps.context.outputs.mimalloc_revision }}
sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }}
swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }}
swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }}
swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }}
swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }}
swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }}
swift_cmark_version: ${{ steps.context.outputs.swift_cmark_version }}
swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }}
swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }}
swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }}
swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }}
swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }}
swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }}
swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }}
swift_format_revision: ${{ steps.context.outputs.swift_format_revision }}
swift_foundation_revision: ${{ steps.context.outputs.swift_foundation_revision }}
swift_foundation_icu_revision: ${{ steps.context.outputs.swift_foundation_icu_revision }}
swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }}
swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }}
swift_lmdb_revision: ${{ steps.context.outputs.swift_lmdb_revision }}
swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }}
swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }}
swift_revision: ${{ steps.context.outputs.swift_revision }}
swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }}
swift_system_revision: ${{ steps.context.outputs.swift_system_revision }}
swift_testing_revision: ${{ steps.context.outputs.swift_testing_revision }}
swift_toolchain_sqlite_revision: ${{ steps.context.outputs.swift_toolchain_sqlite_revision }}
swift_toolchain_sqlite_version: ${{ steps.context.outputs.swift_toolchain_sqlite_version }}
swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }}
yams_revision: ${{ steps.context.outputs.yams_revision }}
zlib_revision: ${{ steps.context.outputs.zlib_revision }}
zlib_version: ${{ steps.context.outputs.zlib_version }}
ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }}
WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}
WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}
DARWIN_CMAKE_C_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}
DARWIN_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}
DARWIN_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}
DARWIN_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}
ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_NDK_VERSION: ${{ steps.context.outputs.ANDROID_NDK_VERSION }}
WINDOWS_CMAKE_Swift_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}
DARWIN_CMAKE_Swift_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}
debug_info: ${{ steps.context.outputs.debug_info }}
signed: ${{ steps.context.outputs.signed }}
swift_version: ${{ steps.context.outputs.swift_version }}
swift_tag: ${{ steps.context.outputs.swift_tag }}
windows_arm64_build_runner: ${{ steps.context.outputs.windows_arm64_build_runner }}
windows_arm64_compilers_runner: ${{ steps.context.outputs.windows_arm64_compilers_runner }}
windows_build_arch: ${{ steps.context.outputs.windows_build_arch }}
windows_build_cpu: ${{ steps.context.outputs.windows_build_cpu }}
windows_x64_build_runner: ${{ steps.context.outputs.windows_x64_build_runner }}
windows_x64_compilers_runner: ${{ steps.context.outputs.windows_x64_compilers_runner }}
mac_build_runner: ${{ steps.context.outputs.mac_build_runner }}
windows_arm64_build_matrix: ${{ steps.setup-matrix.outputs.windows_arm64_build_matrix }}
windows_arm64_host_matrix: ${{ steps.setup-matrix.outputs.windows_arm64_host_matrix }}
windows_arm64_target_matrix: ${{ steps.setup-matrix.outputs.windows_arm64_target_matrix }}
windows_x64_build_matrix: ${{ steps.setup-matrix.outputs.windows_x64_build_matrix }}
windows_x64_host_matrix: ${{ steps.setup-matrix.outputs.windows_x64_host_matrix }}
windows_x64_target_matrix: ${{ steps.setup-matrix.outputs.windows_x64_target_matrix }}
darwin_host_matrix: ${{ steps.setup-matrix.outputs.darwin_host_matrix }}
darwin_build_matrix: ${{ steps.setup-matrix.outputs.darwin_build_matrix }}
darwin_target_matrix: ${{ steps.setup-matrix.outputs.darwin_target_matrix }}
steps:
- id: context
name: Generate Build Context
run: |
# TODO(compnerd) can we make this more silent?
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils
# Which branch is this workflow based on
branch_version_string=${{ inputs.swift_version || '0.0.0' }}
if [[ $branch_version_string == *.* ]]; then
branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }')
else
branch_name="release/$branch_version_string"
fi
repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name
repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all)
if [[ "${{ inputs.swift_tag }}" != "" ]] ; then
tee -a "${GITHUB_OUTPUT}" <<-EOF
indexstore_db_revision=refs/tags/${{ inputs.swift_tag }}
llvm_project_revision=refs/tags/${{ inputs.swift_tag }}
mimalloc_revision=refs/tags/v2.1.7
sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }}
swift_revision=refs/tags/${{ inputs.swift_tag }}
swift_argument_parser_revision=refs/tags/1.4.0
swift_asn1_revision=refs/tags/0.7.0
swift_atomics_revision=refs/tags/1.2.0
swift_certificates_revision=refs/tags/0.1.0
swift_cmark_revision=refs/tags/${{ inputs.swift_tag }}
swift_collections_revision=refs/tags/1.1.2
swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }}
swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }}
swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }}
swift_crypto_revision=refs/tags/3.0.0
swift_driver_revision=refs/tags/${{ inputs.swift_tag }}
swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }}
swift_format_revision=refs/heads/main
swift_foundation_revison=refs/heads/main
swift_foundation_icu_revision=refs/tags/0.0.8
swift_installer_scripts_revision=refs/heads/main
swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }}
swift_lmdb_revision=refs/heads/main
swift_markdown_revision=refs/tags/${{ inputs.swift_tag }}
swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }}
swift_syntax_revision=refs/tags/${{ inputs.swift_tag }}
swift_system_revision=refs/tags/1.3.0
swift_testing_revision=refs/heads/main
swift_toolchain_sqlite_revision=refs/tags/main
swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }}
curl_revision=refs/tags/curl-8_5_0
ds2_revision=refs/tags/nightly-2024-11-07
libxml2_revision=refs/tags/v2.11.5
yams_revision=refs/tags/5.0.6
zlib_revision=refs/tags/v1.3.1
EOF
else
repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \
xmllint --xpath "//project/@name | //project/@revision" - | \
xargs -n2 | \
awk -F'[= ]' '{
split($2, repo, "/");
gsub(/-/, "_", repo[2]);
print tolower(repo[2]) "_revision=" $4
}' | tee -a "${GITHUB_OUTPUT}"
repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml
fi
echo libxml2_version=2.11.5 >> ${GITHUB_OUTPUT}
echo curl_version=8.9.1 >> ${GITHUB_OUTPUT}
echo swift_toolchain_sqlite_version=3.46.0 >> ${GITHUB_OUTPUT}
echo swift_cmark_version=0.29.0.gfm.13 >> ${GITHUB_OUTPUT}
echo zlib_version=1.3 >> ${GITHUB_OUTPUT}
# FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1.
# see: https://github.com/actions/runner-images/issues/10004
if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then
echo debug_info=true >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_C_FLAGS="-g" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_CXX_FLAGS="-g" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_Swift_FLAGS="-g" >> ${GITHUB_OUTPUT}
else
echo debug_info=false >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_C_FLAGS="" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_CXX_FLAGS="" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo WINDOWS_CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT}
echo DARWIN_CMAKE_Swift_FLAGS="" >> ${GITHUB_OUTPUT}
fi
echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then
# FIXME(compnerd) enable this when requested
echo signed=false >> ${GITHUB_OUTPUT}
else
echo signed=false >> ${GITHUB_OUTPUT}
fi
echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT}
if [[ -n "${{ inputs.swift_tag }}" ]] ; then
echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT}
else
if [[ "$branch_name" == "main" ]] ; then
echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT}
else
echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT}
fi
fi
echo windows_x64_build_runner=${{ inputs.windows_x64_default_runner || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
echo windows_x64_compilers_runner=${{ inputs.windows_x64_compilers_runner || inputs.windows_x64_default_runner || vars.WINDOWS_X64_COMPILERS_BUILD_RUNNER || vars.WINDOWS_X64_DEFAULT_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
echo windows_arm64_build_runner=${{ inputs.windows_arm64_default_runner || vars.WINDOWS_ARM64_DEFAULT_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
echo windows_arm64_compilers_runner=${{ inputs.windows_arm64_compilers_runner || inputs.windows_arm64_default_runner || vars.WINDOWS_ARM64_COMPILERS_BUILD_RUNNER || vars.WINDOWS_ARM64_DEFAULT_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
if [[ "${{ inputs.windows_build_arch }}" == "arm64" ]] ; then
echo windows_build_arch=arm64 >> ${GITHUB_OUTPUT}
echo windows_build_cpu=arm64 >> ${GITHUB_OUTPUT}
else
echo windows_build_arch=amd64 >> ${GITHUB_OUTPUT}
echo windows_build_cpu=x64 >> ${GITHUB_OUTPUT}
fi
# TODO: Make the mac runner configurable.
echo mac_build_runner=macos-latest >> ${GITHUB_OUTPUT}
echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT}
echo ANDROID_NDK_VERSION=r26b >> ${GITHUB_OUTPUT}
- uses: actions/upload-artifact@v4
if: inputs.create_snapshot == true
with:
name: stable.xml
path: stable.xml
if-no-files-found: ignore
- name: Setup matrix
id: setup-matrix
env:
WINDOWS_X64_HOST_MATRIX: >-
{
"include": [
{
"arch": "amd64",
"cpu": "x86_64",
"triple": "x86_64-unknown-windows-msvc",
"compiler_target": "x86_64-unknown-windows-msvc",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64"
},
{
"arch": "arm64",
"cpu": "aarch64",
"triple": "aarch64-unknown-windows-msvc",
"compiler_target": "aarch64-unknown-windows-msvc",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
}
]
}
WINDOWS_ARM64_HOST_MATRIX: >-
{
"include": [
{
"arch": "arm64",
"cpu": "aarch64",
"triple": "aarch64-unknown-windows-msvc",
"compiler_target": "aarch64-unknown-windows-msvc",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
}
]
}
WINDOWS_X64_BUILD_MATRIX: >-
{
"include": [
{
"arch": "amd64",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64"
}
]
}
WINDOWS_ARM64_BUILD_MATRIX: >-
{
"include": [
{
"arch": "arm64",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
}
]
}
WINDOWS_X64_TARGET_MATRIX: >-
{
"include": [
{
"arch": "amd64",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64"
},
{
"arch": "arm64",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
},
{
"arch": "x86",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=X86"
},
{
"arch": "arm64",
"os": "Android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a"
},
{
"arch": "armv7",
"os": "Android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a"
},
{
"arch": "i686",
"os": "Android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86"
},
{
"arch": "x86_64",
"os": "Android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64"
}
]
}
WINDOWS_ARM64_TARGET_MATRIX: >-
{
"include": [
{
"arch": "amd64",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64"
},
{
"arch": "arm64",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
},
{
"arch": "x86",
"os": "Windows",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=X86"
}
]
}
DARWIN_HOST_MATRIX: >-
{
"include": [
{
"arch": "x86_64",
"os": "Darwin",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}\"",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=x86_64"
},
{
"arch": "arm64",
"os": "Darwin",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }} -D CMAKE_SHARED_LINKER_FLAGS=${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=arm64"
}
]
}
DARWIN_BUILD_MATRIX: >-
{
"include": [
{
"arch": "arm64",
"os": "Darwin",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=arm64"
}
]
}
DARWIN_TARGET_MATRIX: >-
{
"include": [
{
"arch": "x86_64",
"os": "Darwin",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=x86_64"
},
{
"arch": "arm64",
"os": "Darwin",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=arm64"
}
]
}
run: |
echo "windows_x64_host_matrix=$(jq -r -c '.' <<< ${WINDOWS_X64_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
echo "windows_arm64_host_matrix=$(jq -r -c '.' <<< ${WINDOWS_ARM64_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
echo "windows_x64_build_matrix=$(jq -r -c '.' <<< ${WINDOWS_X64_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
echo "windows_arm64_build_matrix=$(jq -r -c '.' <<< ${WINDOWS_ARM64_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
echo "windows_x64_target_matrix=$(jq -r -c '.' <<< ${WINDOWS_X64_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
echo "windows_arm64_target_matrix=$(jq -r -c '.' <<< ${WINDOWS_ARM64_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
echo "darwin_host_matrix=$(jq -r -c '.' <<< ${DARWIN_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
echo "darwin_build_matrix=$(jq -r -c '.' <<< ${DARWIN_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
echo "darwin_target_matrix=$(jq -r -c '.' <<< ${DARWIN_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
windows-build:
needs: [context]
name: Windows Swift Toolchains Build
uses: ./.github/workflows/swift-toolchain.yml
with:
build_os: Windows
build_arch: ${{ needs.context.outputs.windows_build_arch }}
build_matrix: ${{ needs.context.outputs[format('windows_{0}_build_matrix', needs.context.outputs.windows_build_cpu)] }}
host_matrix: ${{ needs.context.outputs[format('windows_{0}_host_matrix', needs.context.outputs.windows_build_cpu)] }}
target_matrix: ${{ needs.context.outputs[format('windows_{0}_target_matrix', needs.context.outputs.windows_build_cpu)] }}
curl_revision: ${{ needs.context.outputs.curl_revision }}
curl_version: ${{ needs.context.outputs.curl_version }}
ds2_revision: ${{ needs.context.outputs.ds2_revision }}
indexstore_db_revision: ${{ needs.context.outputs.indexstore_db_revision }}
libxml2_revision: ${{ needs.context.outputs.libxml2_revision }}
libxml2_version: ${{ needs.context.outputs.libxml2_version }}
llvm_project_revision: ${{ needs.context.outputs.llvm_project_revision }}
mimalloc_revision: ${{ needs.context.outputs.mimalloc_revision }}
sourcekit_lsp_revision: ${{ needs.context.outputs.sourcekit_lsp_revision }}
swift_argument_parser_revision: ${{ needs.context.outputs.swift_argument_parser_revision }}
swift_asn1_revision: ${{ needs.context.outputs.swift_asn1_revision }}
swift_atomics_revision: ${{ needs.context.outputs.swift_atomics_revision }}
swift_certificates_revision: ${{ needs.context.outputs.swift_certificates_revision }}
swift_cmark_revision: ${{ needs.context.outputs.swift_cmark_revision }}
swift_cmark_version: ${{ needs.context.outputs.swift_cmark_version }}
swift_collections_revision: ${{ needs.context.outputs.swift_collections_revision }}
swift_corelibs_foundation_revision: ${{ needs.context.outputs.swift_corelibs_foundation_revision }}
swift_corelibs_libdispatch_revision: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }}
swift_corelibs_xctest_revision: ${{ needs.context.outputs.swift_corelibs_xctest_revision }}
swift_crypto_revision: ${{ needs.context.outputs.swift_crypto_revision }}
swift_driver_revision: ${{ needs.context.outputs.swift_driver_revision }}
swift_experimental_string_processing_revision: ${{ needs.context.outputs.swift_experimental_string_processing_revision }}
swift_format_revision: ${{ needs.context.outputs.swift_format_revision }}
swift_foundation_revision: ${{ needs.context.outputs.swift_foundation_revision }}
swift_foundation_icu_revision: ${{ needs.context.outputs.swift_foundation_icu_revision }}
swift_installer_scripts_revision: ${{ needs.context.outputs.swift_installer_scripts_revision }}
swift_llbuild_revision: ${{ needs.context.outputs.swift_llbuild_revision }}
swift_lmdb_revision: ${{ needs.context.outputs.swift_lmdb_revision }}
swift_markdown_revision: ${{ needs.context.outputs.swift_markdown_revision }}
swift_package_manager_revision: ${{ needs.context.outputs.swift_package_manager_revision }}
swift_revision: ${{ needs.context.outputs.swift_revision }}
swift_syntax_revision: ${{ needs.context.outputs.swift_syntax_revision }}
swift_system_revision: ${{ needs.context.outputs.swift_system_revision }}
swift_testing_revision: ${{ needs.context.outputs.swift_testing_revision }}
swift_toolchain_sqlite_revision: ${{ needs.context.outputs.swift_toolchain_sqlite_revision }}
swift_toolchain_sqlite_version: ${{ needs.context.outputs.swift_toolchain_sqlite_version }}
swift_tools_support_core_revision: ${{ needs.context.outputs.swift_tools_support_core_revision }}
yams_revision: ${{ needs.context.outputs.yams_revision }}
zlib_revision: ${{ needs.context.outputs.zlib_revision }}
zlib_version: ${{ needs.context.outputs.zlib_version }}
ANDROID_API_LEVEL: ${{ needs.context.outputs.ANDROID_API_LEVEL }}
WINDOWS_CMAKE_C_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
WINDOWS_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}
WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_CMAKE_C_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
ANDROID_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_NDK_VERSION: ${{ needs.context.outputs.ANDROID_NDK_VERSION }}
CMAKE_Swift_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}
debug_info: ${{ fromJSON(needs.context.outputs.debug_info) }}
signed: ${{ fromJSON(needs.context.outputs.signed) }}
swift_version: ${{ needs.context.outputs.swift_version }}
swift_tag: ${{ needs.context.outputs.swift_tag }}
default_build_runner: ${{ needs.context.outputs[format('windows_{0}_build_runner', needs.context.outputs.windows_build_cpu)] }}
compilers_build_runner: ${{ needs.context.outputs[format('windows_{0}_compilers_runner', needs.context.outputs.windows_build_cpu)] }}
build_android: ${{ inputs.build_android }}
secrets:
SYMBOL_SERVER_PAT: ${{ secrets.SYMBOL_SERVER_PAT }}
CERTIFICATE: ${{ secrets.CERTIFICATE }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
mac-build:
# TODO: Enable the mac build.
if: false
needs: [context]
name: macOS Swift Toolchains Build
uses: ./.github/workflows/swift-toolchain.yml
with:
build_os: Darwin
build_arch: arm64
build_matrix: ${{ needs.context.outputs.darwin_build_matrix }}
host_matrix: ${{ needs.context.outputs.darwin_host_matrix }}
target_matrix: ${{ needs.context.outputs.darwin_target_matrix }}
curl_revision: ${{ needs.context.outputs.curl_revision }}
curl_version: ${{ needs.context.outputs.curl_version }}
ds2_revision: ${{ needs.context.outputs.ds2_revision }}
indexstore_db_revision: ${{ needs.context.outputs.indexstore_db_revision }}
libxml2_revision: ${{ needs.context.outputs.libxml2_revision }}
libxml2_version: ${{ needs.context.outputs.libxml2_version }}
llvm_project_revision: ${{ needs.context.outputs.llvm_project_revision }}
mimalloc_revision: ${{ needs.context.outputs.mimalloc_revision }}
sourcekit_lsp_revision: ${{ needs.context.outputs.sourcekit_lsp_revision }}
swift_argument_parser_revision: ${{ needs.context.outputs.swift_argument_parser_revision }}
swift_asn1_revision: ${{ needs.context.outputs.swift_asn1_revision }}
swift_atomics_revision: ${{ needs.context.outputs.swift_atomics_revision }}
swift_certificates_revision: ${{ needs.context.outputs.swift_certificates_revision }}
swift_cmark_revision: ${{ needs.context.outputs.swift_cmark_revision }}
swift_cmark_version: ${{ needs.context.outputs.swift_cmark_version }}
swift_collections_revision: ${{ needs.context.outputs.swift_collections_revision }}
swift_corelibs_foundation_revision: ${{ needs.context.outputs.swift_corelibs_foundation_revision }}
swift_corelibs_libdispatch_revision: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }}
swift_corelibs_xctest_revision: ${{ needs.context.outputs.swift_corelibs_xctest_revision }}
swift_crypto_revision: ${{ needs.context.outputs.swift_crypto_revision }}
swift_driver_revision: ${{ needs.context.outputs.swift_driver_revision }}
swift_experimental_string_processing_revision: ${{ needs.context.outputs.swift_experimental_string_processing_revision }}
swift_format_revision: ${{ needs.context.outputs.swift_format_revision }}
swift_foundation_revision: ${{ needs.context.outputs.swift_foundation_revision }}
swift_foundation_icu_revision: ${{ needs.context.outputs.swift_foundation_icu_revision }}
swift_installer_scripts_revision: ${{ needs.context.outputs.swift_installer_scripts_revision }}
swift_llbuild_revision: ${{ needs.context.outputs.swift_llbuild_revision }}
swift_lmdb_revision: ${{ needs.context.outputs.swift_lmdb_revision }}
swift_markdown_revision: ${{ needs.context.outputs.swift_markdown_revision }}
swift_package_manager_revision: ${{ needs.context.outputs.swift_package_manager_revision }}
swift_revision: ${{ needs.context.outputs.swift_revision }}
swift_syntax_revision: ${{ needs.context.outputs.swift_syntax_revision }}
swift_system_revision: ${{ needs.context.outputs.swift_system_revision }}
swift_testing_revision: ${{ needs.context.outputs.swift_testing_revision }}
swift_toolchain_sqlite_revision: ${{ needs.context.outputs.swift_toolchain_sqlite_revision }}
swift_toolchain_sqlite_version: ${{ needs.context.outputs.swift_toolchain_sqlite_version }}
swift_tools_support_core_revision: ${{ needs.context.outputs.swift_tools_support_core_revision }}
yams_revision: ${{ needs.context.outputs.yams_revision }}
zlib_revision: ${{ needs.context.outputs.zlib_revision }}
zlib_version: ${{ needs.context.outputs.zlib_version }}
ANDROID_API_LEVEL: ${{ needs.context.outputs.ANDROID_API_LEVEL }}
WINDOWS_CMAKE_C_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}
WINDOWS_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}
WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}
WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_CMAKE_C_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }}
ANDROID_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
ANDROID_NDK_VERSION: ${{ needs.context.outputs.ANDROID_NDK_VERSION }}
CMAKE_Swift_FLAGS: ${{ needs.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}
debug_info: ${{ fromJSON(needs.context.outputs.debug_info) }}
signed: ${{ fromJSON(needs.context.outputs.signed) }}
swift_version: ${{ needs.context.outputs.swift_version }}
swift_tag: ${{ needs.context.outputs.swift_tag }}
default_build_runner: ${{ needs.context.outputs.mac_build_runner }}
compilers_build_runner: ${{ needs.context.outputs.mac_build_runner }}
secrets:
SYMBOL_SERVER_PAT: ${{ secrets.SYMBOL_SERVER_PAT }}
CERTIFICATE: ${{ secrets.CERTIFICATE }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
snapshot:
runs-on: ubuntu-latest
needs: [context, windows-build]
if: inputs.create_snapshot == true && github.event_name == 'schedule'
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/main
show-progress: false
- uses: actions/download-artifact@v4
with:
name: stable.xml
- run: |
git config --global user.name 'github-action[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if ! git diff --exit-code ; then
git add stable.xml
git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}"
git push origin HEAD:main
fi
release:
runs-on: ubuntu-latest
needs: [context, windows-build]
if: inputs.create_release == true
steps:
- uses: actions/download-artifact@v4
with:
name: installer-amd64
path: ${{ github.workspace }}/tmp/amd64
- uses: actions/download-artifact@v4
with:
name: installer-arm64
path: ${{ github.workspace }}/tmp/arm64
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
branch_version_string=${{ inputs.swift_version || '0.0.0' }}
if [[ $branch_version_string == "0.0.0" ]]; then
latest="true"
else
latest="false"
fi
# Create Release
gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} --latest=${latest}
# AMD64
cd ${{ github.workspace }}/tmp/amd64
mv installer.exe installer-amd64.exe
gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }}
shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256
gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }}
# ARM64
cd ${{ github.workspace }}/tmp/arm64
mv installer.exe installer-arm64.exe
gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }}
shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256
gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }}