@@ -2019,9 +2019,85 @@ jobs:
2019
2019
name : swift-format.exe
2020
2020
path : ${{ github.workspace }}/SourceCache/swift-format/.build/release/swift-format.exe
2021
2021
2022
+ swift_inspect :
2023
+ runs-on : windows-latest
2024
+ needs : [context, installer]
2025
+
2026
+ steps :
2027
+ - uses : actions/download-artifact@v3
2028
+ with :
2029
+ name : installer-amd64
2030
+ path : ${{ github.workspace }}/tmp
2031
+
2032
+ # TODO(compnerd) can this be done via a re-usage workflow for swift-format?
2033
+
2034
+ # TODO(compnerd): migrate this to compnerd/gha-setup-swift after the work that @mangini is doing is completed
2035
+ - run : |
2036
+ function Update-EnvironmentVariables {
2037
+ foreach ($level in "Machine", "User") {
2038
+ [Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
2039
+ # For Path variables, append the new values, if they're not already in there
2040
+ if ($_.Name -Match 'Path$') {
2041
+ $_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';'
2042
+ }
2043
+ $_
2044
+ } | Set-Content -Path { "Env:$($_.Name)" }
2045
+ }
2046
+ }
2047
+ try {
2048
+ Write-Host "Starting Install installer.exe..."
2049
+ $Process = Start-Process -FilePath ${{ github.workspace }}/tmp/installer.exe -ArgumentList ("-q") -Wait -PassThru
2050
+ $ExitCode = $Process.ExitCode
2051
+ if ($ExitCode -eq 0 -or $ExitCode -eq 3010) {
2052
+ Write-Host "Installation successful"
2053
+ } else {
2054
+ Write-Host "non-zero exit code returned by the installation process: $ExitCode"
2055
+ exit $ExitCode
2056
+ }
2057
+ } catch {
2058
+ Write-Host "Failed to install: $($_.Exception.Message)"
2059
+ exit 1
2060
+ }
2061
+ Update-EnvironmentVariables
2062
+ # Reset Path and environment
2063
+ echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
2064
+ Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
2065
+
2066
+ -
uses :
microsoft/[email protected]
2067
+
2068
+ - uses : actions/checkout@v3
2069
+ with :
2070
+ repository : apple/swift
2071
+ ref : ${{ needs.context.outputs.swift_revision }}
2072
+ path : ${{ github.workspace }}/SourceCache/swift
2073
+
2074
+ - run : |
2075
+ swift build -c release -Xswiftc -gnone -Xcc -I"${env:SDKROOT}"\usr\include\swift\SwiftRemoteMirror -Xlinker ${env:SDKROOT}\usr\lib\swift\windows\x86_64\swiftRemoteMirror.lib
2076
+ working-directory: ${{ github.workspace }}\SourceCache\swift\tools\swift-inspect
2077
+
2078
+ - uses : actions/checkout@v3
2079
+ with :
2080
+ ref : ${{ needs.context.outputs.swift_installer_scripts_revision }}
2081
+ repository : apple/swift-installer-scripts
2082
+ path : ${{ github.workspace }}/SourceCache/swift-installer-scripts
2083
+
2084
+ - name : Package
2085
+ run : |
2086
+ msbuild -nologo -restore -p:Configuration=Release -p:RunWixToolsOutOfProc=true -p:OutputPath=${{ github.workspace }}\artifacts -p:ProductVersion=${{ needs.context.outputs.swift_version }} -p:SWIFT_INSPECT_BUILD=${{ github.workspace }}\SourceCache\swift\tools\swift-inspect\.build\release ${{ github.workspace }}\SourceCache\swift-installer-scripts\platforms\Windows\swift-inspect.wixproj
2087
+
2088
+ - uses : actions/upload-artifact@v2
2089
+ with :
2090
+ name : swift-inspect-msi
2091
+ path : ${{ github.workspace }}/artifacts/swift-inspect.msi
2092
+
2093
+ - uses : actions/upload-artifact@v2
2094
+ with :
2095
+ name : swift-inspect.exe
2096
+ path : ${{ github.workspace }}/SourceCache/swift/tools/swift-inspect/.build/release/swift-inspect.exe
2097
+
2022
2098
snapshot :
2023
2099
runs-on : ubuntu-latest
2024
- needs : [context, swift_format]
2100
+ needs : [context, smoke_test, swift_format, swift_inspect ]
2025
2101
2026
2102
steps :
2027
2103
- uses : actions/checkout@v3
@@ -2043,7 +2119,7 @@ jobs:
2043
2119
2044
2120
release :
2045
2121
runs-on : ubuntu-latest
2046
- needs : [smoke_test, swift_format]
2122
+ needs : [smoke_test, swift_format, swift_inspect ]
2047
2123
2048
2124
steps :
2049
2125
- uses : actions/download-artifact@v3
0 commit comments