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