@@ -358,33 +358,37 @@ jobs:
358
358
359
359
ds2_tools :
360
360
# TODO: Build this on macOS or make an equivalent Mac-only job
361
- # There is currently no Android NDK for Windows ARM64 so build ds2 only on Windows X64 host only
362
- if : inputs.build_android
363
361
runs-on : ${{ inputs.default_build_runner }}
364
362
365
363
name : ds2 Build Tools
366
364
367
365
steps :
368
366
- uses : actions/checkout@v4
367
+ # There is currently no Android NDK for Windows ARM64 so build ds2_tools only on Windows X64 host only
368
+ if : inputs.build_android
369
369
with :
370
370
repository : compnerd/ds2
371
371
ref : ${{ inputs.ds2_revision }}
372
372
path : ${{ github.workspace }}/SourceCache/ds2
373
373
show-progress : false
374
374
375
375
- uses : compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main
376
+ if : inputs.build_android
376
377
with :
377
378
host_arch : ${{ inputs.build_arch }}
378
379
components : ' Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
379
380
arch : amd64
380
381
381
382
# TODO(issues/205): Preload Chocolatey package manager on Azure images so we can remove this step.
382
383
- uses : andrurogerz/ensure-chocolatey@v1
384
+ if : inputs.build_android
383
385
384
386
- name : Install Flex and Bison Tools
385
387
run : choco install winflexbison3
388
+ if : inputs.build_android
386
389
387
390
- name : Configure RegsGen2
391
+ if : inputs.build_android
388
392
run : |
389
393
cmake -B ${{ github.workspace }}/BinaryCache/RegsGen2 `
390
394
-S ${{ github.workspace }}/SourceCache/ds2/Tools/RegsGen2 `
@@ -397,18 +401,18 @@ jobs:
397
401
-G Ninja
398
402
399
403
- name : Build RegsGen2
404
+ if : inputs.build_android
400
405
run : cmake --build ${{ github.workspace }}/BinaryCache/RegsGen2 --config Release
401
406
402
407
- uses : actions/upload-artifact@v4
408
+ if : inputs.build_android
403
409
with :
404
410
name : windows-regsgen2
405
411
path : |
406
412
${{ github.workspace }}/BinaryCache/RegsGen2/regsgen2.exe
407
413
408
414
ds2 :
409
415
# TODO: Build this on macOS or make an equivalent Mac-only job
410
- # There is currently no Android NDK for Windows ARM64 so build ds2 only on Windows X64 host only
411
- if : inputs.build_android
412
416
needs : [ds2_tools]
413
417
runs-on : ${{ inputs.default_build_runner }}
414
418
@@ -452,36 +456,43 @@ jobs:
452
456
453
457
steps :
454
458
- uses : actions/checkout@v4
459
+ # There is currently no Android NDK for Windows ARM64 so build ds2 only on Windows X64 host only
460
+ if : inputs.build_android
455
461
with :
456
462
repository : compnerd/ds2
457
463
ref : ${{ inputs.ds2_revision }}
458
464
path : ${{ github.workspace }}/SourceCache/ds2
459
465
show-progress : false
460
466
461
467
- uses : compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main
468
+ if : inputs.build_android
462
469
with :
463
470
host_arch : ${{ inputs.build_arch }}
464
471
components : ' Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
465
472
arch : ${{ matrix.arch }}
466
473
467
474
# TODO(issues/205): Preload Chocolatey package manager on Azure images so we can remove this step.
468
475
- uses : andrurogerz/ensure-chocolatey@v1
476
+ if : inputs.build_android
469
477
470
478
- name : Install Flex and Bison Tools
479
+ if : inputs.build_android
471
480
run : choco install winflexbison3
472
481
473
482
- uses : actions/download-artifact@v4
483
+ if : inputs.build_android
474
484
with :
475
485
name : windows-regsgen2
476
486
path : ${{ github.workspace }}/BinaryCache/RegsGen2
477
487
478
488
- uses : nttld/setup-ndk@v1
479
- if : matrix.os == 'Android'
489
+ if : matrix.os == 'Android' && inputs.build_android
480
490
id : setup-ndk
481
491
with :
482
492
ndk-version : ${{ inputs.ANDROID_NDK_VERSION }}
483
493
484
494
- name : Configure DS2
495
+ if : inputs.build_android
485
496
run : |
486
497
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
487
498
cmake -B ${{ github.workspace }}/BinaryCache/ds2 `
@@ -500,12 +511,15 @@ jobs:
500
511
-G Ninja
501
512
502
513
- name : Build DS2
514
+ if : inputs.build_android
503
515
run : cmake --build ${{ github.workspace }}/BinaryCache/ds2
504
516
505
517
- name : Install DS2
518
+ if : inputs.build_android
506
519
run : cmake --build ${{ github.workspace }}/BinaryCache/ds2 --target install
507
520
508
521
- uses : actions/upload-artifact@v4
522
+ if : inputs.build_android
509
523
with :
510
524
name : ds2-${{ matrix.os }}-${{ matrix.arch }}
511
525
path : ${{ github.workspace }}/BinaryCache/Library/Developer
@@ -786,7 +800,7 @@ jobs:
786
800
run : |
787
801
$env:SWIFTCI_USE_LOCAL_DEPS=1
788
802
$LinkerFlags = if ("${{ matrix.os }}" -eq "Windows") {
789
- @("-Xlinker", "${env:SDKROOT}/usr/lib/swift/windows/x86_64 /swiftCore.lib")
803
+ @("-Xlinker", "${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }} /swiftCore.lib")
790
804
} else {
791
805
@()
792
806
}
@@ -795,6 +809,7 @@ jobs:
795
809
--configuration release `
796
810
--package-path ${{ github.workspace }}/SourceCache/swift-driver `
797
811
--build-path ${{ github.workspace }}/BinaryCache/swift-driver `
812
+ --triple ${{ matrix.compiler_target }} `
798
813
@LinkerFlags
799
814
800
815
- name : Copy binaries
@@ -1684,9 +1699,8 @@ jobs:
1684
1699
components : ' Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
1685
1700
arch : ${{ matrix.arch }}
1686
1701
1687
- # NOTE(compnerd): we execute unconditionally as we reference outputs
1688
1702
- uses : nttld/setup-ndk@v1
1689
- if : matrix.os == 'Android'
1703
+ if : matrix.os == 'Android' && inputs.build_android
1690
1704
id : setup-ndk
1691
1705
with :
1692
1706
ndk-version : ${{ inputs.ANDROID_NDK_VERSION }}
@@ -1827,15 +1841,7 @@ jobs:
1827
1841
1828
1842
strategy :
1829
1843
fail-fast : false
1830
- matrix :
1831
- include :
1832
- - arch : ' amd64'
1833
- cpu : ' x86_64'
1834
- triple : ' x86_64-unknown-windows-msvc'
1835
-
1836
- - arch : ' arm64'
1837
- cpu : ' aarch64'
1838
- triple : ' aarch64-unknown-windows-msvc'
1844
+ matrix : ${{ fromJSON(inputs.host_matrix) }}
1839
1845
1840
1846
name : Windows ${{ matrix.arch }} Macros
1841
1847
@@ -2168,13 +2174,12 @@ jobs:
2168
2174
arch : ${{ matrix.arch }}
2169
2175
2170
2176
# FIXME(compnerd): workaround CMake 3.29-3.30 issue
2171
- - uses : jwlawson/actions-setup- cmake@v2
2177
+ - uses : lukka/get- cmake@main
2172
2178
with :
2173
- cmake-version : ' 3.28'
2179
+ cmakeVersion : 3.28.6
2174
2180
2175
- # NOTE(compnerd): we execute unconditionally as we reference outputs
2176
2181
- uses : nttld/setup-ndk@v1
2177
- if : matrix.os == 'Android'
2182
+ if : matrix.os == 'Android' && inputs.build_android
2178
2183
id : setup-ndk
2179
2184
with :
2180
2185
ndk-version : ${{ inputs.ANDROID_NDK_VERSION }}
@@ -3599,7 +3604,6 @@ jobs:
3599
3604
3600
3605
package_android_sdk_runtime :
3601
3606
# TODO: Build this on macOS or make an equivalent Mac-only job
3602
- if : inputs.build_android
3603
3607
name : Package Android SDK & Runtime
3604
3608
needs : [stdlib, ds2, sdk]
3605
3609
runs-on : ${{ inputs.default_build_runner }}
@@ -3623,27 +3627,33 @@ jobs:
3623
3627
3624
3628
steps :
3625
3629
- uses : actions/download-artifact@v4
3630
+ # There is currently no Android NDK for Windows ARM64 so build Android only on Windows X64 host only
3631
+ if : inputs.build_android
3626
3632
with :
3627
3633
name : Android-stdlib-${{ matrix.arch }}
3628
3634
path : ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform
3629
3635
- uses : actions/download-artifact@v4
3636
+ if : inputs.build_android
3630
3637
with :
3631
3638
name : Android-sdk-${{ matrix.arch }}
3632
3639
path : ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform
3633
3640
3634
3641
- uses : actions/download-artifact@v4
3642
+ if : inputs.build_android
3635
3643
with :
3636
3644
name : ds2-Android-${{ matrix.arch }}
3637
3645
path : ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform/Developer/Library/${{ matrix.triple_no_api_level }}
3638
3646
3639
3647
- uses : actions/checkout@v4
3648
+ if : inputs.build_android
3640
3649
with :
3641
3650
repository : swiftlang/swift-installer-scripts
3642
3651
ref : ${{ inputs.swift_installer_scripts_revision }}
3643
3652
path : ${{ github.workspace }}/SourceCache/swift-installer-scripts
3644
3653
show-progress : false
3645
3654
3646
3655
- uses : compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main
3656
+ if : inputs.build_android
3647
3657
with :
3648
3658
host_arch : ${{ inputs.build_arch }}
3649
3659
components : ' Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
@@ -3655,15 +3665,17 @@ jobs:
3655
3665
Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}'
3656
3666
certutil.exe -decode $CertificatePath $PFXPath
3657
3667
Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append
3658
- if: ${{ inputs.signed }}
3668
+ if: ${{ inputs.signed && inputs.build_android }}
3659
3669
3660
3670
- name : Install WixToolset.Sdk
3671
+ if : inputs.build_android
3661
3672
run : |
3662
3673
if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) {
3663
3674
Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force
3664
3675
}
3665
3676
3666
3677
- name : Package SDK
3678
+ if : inputs.build_android
3667
3679
run : |
3668
3680
msbuild -nologo -restore -maxCpuCount `
3669
3681
-p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ `
@@ -3679,6 +3691,7 @@ jobs:
3679
3691
${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/sdk/drd/sdk.wixproj
3680
3692
3681
3693
- uses : actions/upload-artifact@v4
3694
+ if : inputs.build_android
3682
3695
with :
3683
3696
name : sdk-android-${{ matrix.arch }}-msi
3684
3697
path : |
0 commit comments