@@ -762,25 +762,49 @@ jobs:
762
762
- name : Build early swift-driver
763
763
run : |
764
764
$env:SWIFTCI_USE_LOCAL_DEPS=1
765
+ if ("${{ matrix.os }}" -eq "Windows") {
766
+ $LinkerFlags = @("-Xlinker", "${env:SDKROOT}/usr/lib/swift/windows/x86_64/swiftCore.lib")
767
+ } else {
768
+ $LinkerFlags = @()
769
+ }
765
770
766
771
swift build `
767
772
--configuration release `
768
773
--package-path ${{ github.workspace }}/SourceCache/swift-driver `
769
774
--build-path ${{ github.workspace }}/BinaryCache/swift-driver `
770
- -Xlinker "${env:SDKROOT}/usr/lib/swift/windows/x86_64/swiftCore.lib"
775
+ @LinkerFlags
776
+
777
+ - name : Copy binaries
778
+ run : |
779
+ if ("${{ matrix.os }}" -eq "Windows") {
780
+ $ExeSuffix = ".exe"
781
+ if ("${{ matrix.arch }}" -eq "arm64") {
782
+ $Cpu = "aarch64"
783
+ } else {
784
+ $Cpu = "x86_64"
785
+ }
786
+ $SourceBinDir = Join-Path "${{ github.workspace }}" "BinaryCache" "swift-driver" "${Cpu}-unknown-windows-msvc" "release"
787
+ } else {
788
+ $ExeSuffix = ""
789
+ $Cpu = "${{ matrix.arch }}"
790
+ $SourceBinDir = Join-Path "${{ github.workspace }}" "BinaryCache" "swift-driver" "${Cpu}-apple-macosx" "release"
791
+ }
792
+ $InstallBinDir = Join-Path "${{ github.workspace }}" "BuildRoot" "bin"
771
793
772
- - id : export-binary-paths
773
- run : |
774
- $Suffix = if ("${{ matrix.os }}" -eq "Windows") { ".exe" } else { "" }
775
- echo "swift_driver=${{ github.workspace }}/BinaryCache/swift-driver/x86_64-unknown-windows-msvc/release/swift-driver${Suffix}" >> $env:GITHUB_OUTPUT
776
- echo "swift_help=${{ github.workspace }}/BinaryCache/swift-driver/x86_64-unknown-windows-msvc/release/swift-help${Suffix}" >> $env:GITHUB_OUTPUT
794
+ # Create the target folder.
795
+ New-Item -ItemType Directory -Path $InstallBinDir -Force
796
+
797
+ # Copy binaries.
798
+ foreach ($bin in @("swift-driver", "swift-help")) {
799
+ $binName = "${bin}${ExeSuffix}"
800
+ $binPath = Join-Path $InstallBinDir $binName
801
+ Copy-Item -Path "${SourceBinDir}/${binName}" -Destination $binPath -Force
802
+ }
777
803
778
804
- uses : actions/upload-artifact@v4
779
805
with :
780
806
name : early-swift-driver-${{ matrix.os }}-${{ matrix.arch }}
781
- path : |
782
- ${{ steps.export-binary-paths.outputs.swift_driver }}
783
- ${{ steps.export-binary-paths.outputs.swift_help }}
807
+ path : ${{ github.workspace }}/BuildRoot
784
808
785
809
compilers :
786
810
# TODO: Build this on macOS or make an equivalent Mac-only job
@@ -815,10 +839,10 @@ jobs:
815
839
with :
816
840
name : cmark-gfm-Windows-${{ matrix.arch }}-${{ inputs.swift_cmark_version }}
817
841
path : ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-${{ inputs.swift_cmark_version }}/usr
818
- - uses : actions/ download-artifact@v4
842
+ - uses : thebrowsercompany/gha- download-tar- artifact@717214c9da2a52b3407a5b0a1f31c00b8fde5681 # main
819
843
with :
820
844
name : early-swift-driver-Windows-amd64
821
- path : ${{ github.workspace }}/BinaryCache/swift-driver/release
845
+ path : ${{ github.workspace }}/BinaryCache
822
846
823
847
- uses : actions/checkout@v4
824
848
with :
0 commit comments