36
36
default : true
37
37
required : false
38
38
39
+ create_snapshot :
40
+ description : ' Create Snapshot'
41
+ type : boolean
42
+ default : true
43
+ required : false
44
+
45
+ build_android :
46
+ required : false
47
+ default : false
48
+ type : boolean
49
+
39
50
workflow_call :
40
51
inputs :
41
52
swift_version :
71
82
default : true
72
83
required : false
73
84
74
- windows_default_runner :
75
- description : ' Build runner'
85
+ create_snapshot :
86
+ description : ' Create Snapshot'
87
+ type : boolean
88
+ default : true
89
+ required : false
90
+
91
+ windows_x64_default_runner :
92
+ description : ' X64 Build runner'
76
93
required : false
77
94
type : string
78
95
79
- windows_compilers_runner :
80
- description : ' Build runner for `compilers` job'
96
+ windows_arm64_default_runner :
97
+ description : ' ARM64 Build runner'
98
+ required : false
99
+ type : string
100
+
101
+ windows_x64_compilers_runner :
102
+ description : ' X64 Build runner for `compilers` job'
103
+ required : false
104
+ type : string
105
+
106
+ windows_arm64_compilers_runner :
107
+ description : ' ARM64 Build runner for `compilers` job'
108
+ required : false
81
109
type : string
110
+
111
+ windows_build_arch :
112
+ description : ' Windows build architecture'
82
113
required : false
114
+ type : string
115
+
116
+ build_android :
117
+ required : false
118
+ default : false
119
+ type : boolean
83
120
84
121
secrets :
85
122
SYMBOL_SERVER_PAT :
@@ -153,12 +190,19 @@ jobs:
153
190
signed : ${{ steps.context.outputs.signed }}
154
191
swift_version : ${{ steps.context.outputs.swift_version }}
155
192
swift_tag : ${{ steps.context.outputs.swift_tag }}
156
- windows_build_runner : ${{ steps.context.outputs.windows_build_runner }}
157
- windows_compilers_runner : ${{ steps.context.outputs.windows_compilers_runner }}
193
+ windows_arm64_build_runner : ${{ steps.context.outputs.windows_arm64_build_runner }}
194
+ windows_arm64_compilers_runner : ${{ steps.context.outputs.windows_arm64_compilers_runner }}
195
+ windows_build_arch : ${{ steps.context.outputs.windows_build_arch }}
196
+ windows_build_cpu : ${{ steps.context.outputs.windows_build_cpu }}
197
+ windows_x64_build_runner : ${{ steps.context.outputs.windows_x64_build_runner }}
198
+ windows_x64_compilers_runner : ${{ steps.context.outputs.windows_x64_compilers_runner }}
158
199
mac_build_runner : ${{ steps.context.outputs.mac_build_runner }}
159
- windows_host_matrix : ${{ steps.setup-matrix.outputs.windows_host_matrix }}
160
- windows_build_matrix : ${{ steps.setup-matrix.outputs.windows_build_matrix }}
161
- windows_target_matrix : ${{ steps.setup-matrix.outputs.windows_target_matrix }}
200
+ windows_arm64_build_matrix : ${{ steps.setup-matrix.outputs.windows_arm64_build_matrix }}
201
+ windows_arm64_host_matrix : ${{ steps.setup-matrix.outputs.windows_arm64_host_matrix }}
202
+ windows_arm64_target_matrix : ${{ steps.setup-matrix.outputs.windows_arm64_target_matrix }}
203
+ windows_x64_build_matrix : ${{ steps.setup-matrix.outputs.windows_x64_build_matrix }}
204
+ windows_x64_host_matrix : ${{ steps.setup-matrix.outputs.windows_x64_host_matrix }}
205
+ windows_x64_target_matrix : ${{ steps.setup-matrix.outputs.windows_x64_target_matrix }}
162
206
darwin_host_matrix : ${{ steps.setup-matrix.outputs.darwin_host_matrix }}
163
207
darwin_build_matrix : ${{ steps.setup-matrix.outputs.darwin_build_matrix }}
164
208
darwin_target_matrix : ${{ steps.setup-matrix.outputs.darwin_target_matrix }}
@@ -284,15 +328,26 @@ jobs:
284
328
fi
285
329
fi
286
330
287
- echo windows_build_runner=${{ inputs.windows_default_runner || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
288
- echo windows_compilers_runner=${{ inputs.windows_compilers_runner || inputs.windows_default_runner || vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
331
+ echo windows_x64_build_runner=${{ inputs.windows_x64_default_runner || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
332
+ 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}
333
+ echo windows_arm64_build_runner=${{ inputs.windows_arm64_default_runner || vars.WINDOWS_ARM64_DEFAULT_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
334
+ 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}
335
+ if [[ "${{ inputs.windows_build_arch }}" == "arm64" ]] ; then
336
+ echo windows_build_arch=arm64 >> ${GITHUB_OUTPUT}
337
+ echo windows_build_cpu=arm64 >> ${GITHUB_OUTPUT}
338
+ else
339
+ echo windows_build_arch=amd64 >> ${GITHUB_OUTPUT}
340
+ echo windows_build_cpu=x64 >> ${GITHUB_OUTPUT}
341
+ fi
342
+
289
343
# TODO: Make the mac runner configurable.
290
344
echo mac_build_runner=macos-latest >> ${GITHUB_OUTPUT}
291
345
292
346
echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT}
293
347
echo ANDROID_NDK_VERSION=r26b >> ${GITHUB_OUTPUT}
294
348
295
349
- uses : actions/upload-artifact@v4
350
+ if : inputs.create_snapshot == true
296
351
with :
297
352
name : stable.xml
298
353
path : stable.xml
@@ -301,11 +356,13 @@ jobs:
301
356
- name : Setup matrix
302
357
id : setup-matrix
303
358
env :
304
- WINDOWS_HOST_MATRIX : >-
359
+ WINDOWS_X64_HOST_MATRIX : >-
305
360
{
306
361
"include": [
307
362
{
308
363
"arch": "amd64",
364
+ "cpu": "x86_64",
365
+ "triple": "x86_64-unknown-windows-msvc",
309
366
"compiler_target": "x86_64-unknown-windows-msvc",
310
367
"os": "Windows",
311
368
"cc": "cl",
@@ -317,6 +374,8 @@ jobs:
317
374
},
318
375
{
319
376
"arch": "arm64",
377
+ "cpu": "aarch64",
378
+ "triple": "aarch64-unknown-windows-msvc",
320
379
"compiler_target": "aarch64-unknown-windows-msvc",
321
380
"os": "Windows",
322
381
"cc": "cl",
@@ -328,11 +387,30 @@ jobs:
328
387
}
329
388
]
330
389
}
331
- WINDOWS_BUILD_MATRIX : >-
390
+ WINDOWS_ARM64_HOST_MATRIX : >-
391
+ {
392
+ "include": [
393
+ {
394
+ "arch": "arm64",
395
+ "cpu": "aarch64",
396
+ "triple": "aarch64-unknown-windows-msvc",
397
+ "compiler_target": "aarch64-unknown-windows-msvc",
398
+ "os": "Windows",
399
+ "cc": "cl",
400
+ "cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
401
+ "cxx": "cl",
402
+ "cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
403
+ "swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
404
+ "extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64 -D CMAKE_MT=mt"
405
+ }
406
+ ]
407
+ }
408
+ WINDOWS_X64_BUILD_MATRIX : >-
332
409
{
333
410
"include": [
334
411
{
335
412
"arch": "amd64",
413
+ "compiler_target": "x86_64-unknown-windows-msvc",
336
414
"os": "Windows",
337
415
"cc": "cl",
338
416
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
@@ -343,7 +421,23 @@ jobs:
343
421
}
344
422
]
345
423
}
346
- WINDOWS_TARGET_MATRIX : >-
424
+ WINDOWS_ARM64_BUILD_MATRIX : >-
425
+ {
426
+ "include": [
427
+ {
428
+ "arch": "arm64",
429
+ "compiler_target": "aarch64-unknown-windows-msvc",
430
+ "os": "Windows",
431
+ "cc": "cl",
432
+ "cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
433
+ "cxx": "cl",
434
+ "cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
435
+ "swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
436
+ "extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64 -D CMAKE_MT=mt"
437
+ }
438
+ ]
439
+ }
440
+ WINDOWS_X64_TARGET_MATRIX : >-
347
441
{
348
442
"include": [
349
443
{
@@ -418,6 +512,41 @@ jobs:
418
512
}
419
513
]
420
514
}
515
+ WINDOWS_ARM64_TARGET_MATRIX : >-
516
+ {
517
+ "include": [
518
+ {
519
+ "arch": "amd64",
520
+ "os": "Windows",
521
+ "cc": "cl",
522
+ "cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
523
+ "cxx": "cl",
524
+ "cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
525
+ "swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
526
+ "extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64 -D CMAKE_MT=mt"
527
+ },
528
+ {
529
+ "arch": "arm64",
530
+ "os": "Windows",
531
+ "cc": "cl",
532
+ "cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
533
+ "cxx": "cl",
534
+ "cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
535
+ "swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
536
+ "extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64 -D CMAKE_MT=mt"
537
+ },
538
+ {
539
+ "arch": "x86",
540
+ "os": "Windows",
541
+ "cc": "cl",
542
+ "cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
543
+ "cxx": "cl",
544
+ "cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
545
+ "swiftflags": "",
546
+ "extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=X86 -D CMAKE_MT=mt"
547
+ }
548
+ ]
549
+ }
421
550
DARWIN_HOST_MATRIX : >-
422
551
{
423
552
"include": [
@@ -486,23 +615,27 @@ jobs:
486
615
]
487
616
}
488
617
run : |
489
- echo "windows_host_matrix=$(jq -r -c '.' <<< ${WINDOWS_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
490
- echo "windows_build_matrix=$(jq -r -c '.' <<< ${WINDOWS_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
491
- echo "windows_target_matrix=$(jq -r -c '.' <<< ${WINDOWS_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
618
+ echo "windows_x64_host_matrix=$(jq -r -c '.' <<< ${WINDOWS_X64_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
619
+ echo "windows_arm64_host_matrix=$(jq -r -c '.' <<< ${WINDOWS_ARM64_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
620
+ echo "windows_x64_build_matrix=$(jq -r -c '.' <<< ${WINDOWS_X64_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
621
+ echo "windows_arm64_build_matrix=$(jq -r -c '.' <<< ${WINDOWS_ARM64_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
622
+ echo "windows_x64_target_matrix=$(jq -r -c '.' <<< ${WINDOWS_X64_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
623
+ echo "windows_arm64_target_matrix=$(jq -r -c '.' <<< ${WINDOWS_ARM64_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
492
624
echo "darwin_host_matrix=$(jq -r -c '.' <<< ${DARWIN_HOST_MATRIX})" >> ${GITHUB_OUTPUT}
493
625
echo "darwin_build_matrix=$(jq -r -c '.' <<< ${DARWIN_BUILD_MATRIX})" >> ${GITHUB_OUTPUT}
494
626
echo "darwin_target_matrix=$(jq -r -c '.' <<< ${DARWIN_TARGET_MATRIX})" >> ${GITHUB_OUTPUT}
495
627
496
628
windows-build :
497
629
needs : [context]
498
630
name : Windows Swift Toolchains Build
631
+
499
632
uses : ./.github/workflows/swift-toolchain.yml
500
633
with :
501
634
build_os : Windows
502
- build_arch : amd64
503
- build_matrix : ${{ needs.context.outputs.windows_build_matrix }}
504
- host_matrix : ${{ needs.context.outputs.windows_host_matrix }}
505
- target_matrix : ${{ needs.context.outputs.windows_target_matrix }}
635
+ build_arch : ${{ inputs.windows_build_arch }}
636
+ build_matrix : ${{ needs.context.outputs[format('windows_{0}_build_matrix', needs.context.outputs.windows_build_cpu)] }}
637
+ host_matrix : ${{ needs.context.outputs[format('windows_{0}_host_matrix', needs.context.outputs.windows_build_cpu)] }}
638
+ target_matrix : ${{ needs.context.outputs[format('windows_{0}_target_matrix', needs.context.outputs.windows_build_cpu)] }}
506
639
curl_revision : ${{ needs.context.outputs.curl_revision }}
507
640
curl_version : ${{ needs.context.outputs.curl_version }}
508
641
ds2_revision : ${{ needs.context.outputs.ds2_revision }}
@@ -557,8 +690,9 @@ jobs:
557
690
signed : ${{ fromJSON(needs.context.outputs.signed) }}
558
691
swift_version : ${{ needs.context.outputs.swift_version }}
559
692
swift_tag : ${{ needs.context.outputs.swift_tag }}
560
- default_build_runner : ${{ needs.context.outputs.windows_build_runner }}
561
- compilers_build_runner : ${{ needs.context.outputs.windows_compilers_runner }}
693
+ default_build_runner : ${{ needs.context.outputs[format('windows_{0}_build_runner', needs.context.outputs.windows_build_cpu)] }}
694
+ compilers_build_runner : ${{ needs.context.outputs[format('windows_{0}_compilers_runner', needs.context.outputs.windows_build_cpu)] }}
695
+ build_android : ${{ inputs.build_android }}
562
696
secrets :
563
697
SYMBOL_SERVER_PAT : ${{ secrets.SYMBOL_SERVER_PAT }}
564
698
CERTIFICATE : ${{ secrets.CERTIFICATE }}
@@ -640,7 +774,7 @@ jobs:
640
774
snapshot :
641
775
runs-on : ubuntu-latest
642
776
needs : [context, windows-build]
643
- if : github.event_name == 'schedule'
777
+ if : inputs.create_snapshot == true && github.event_name == 'schedule'
644
778
steps :
645
779
- uses : actions/checkout@v4
646
780
with :
0 commit comments