@@ -108,6 +108,7 @@ runs:
108108
109109 - name : Install Windows SDK version ${{ inputs.windows-sdk-version }}
110110 if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.windows-sdk-version != ''
111+ id : setup-windows-sdk
111112 shell : pwsh
112113 run : |
113114 $WinSdkVersionString = "${{ inputs.windows-sdk-version }}"
@@ -140,13 +141,13 @@ runs:
140141 "--add", "Microsoft.VisualStudio.Component.Windows11SDK.${WinSdkVersionBuild}"
141142 $process.WaitForExit()
142143
144+ $LogFile = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
145+ "log-file=$($LogFile.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
146+
143147 if (Test-Path -Path $Win10SdkIncludeVersion -PathType Container) {
144148 Write-Output "ℹ️ Windows SDK ${WinSdkVersionString} installed successfully."
145149 } else {
146- Write-Output "::error::Failed to install Windows SDK ${WinSdkVersionString}."
147- Write-Output "Installer log:"
148- $log = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
149- Get-Content $log.FullName
150+ Write-Output "::error::Failed to install Windows SDK ${WinSdkVersionString}. Check the installer log for details."
150151 exit 1
151152 }
152153 }
@@ -170,6 +171,13 @@ runs:
170171 }
171172 }
172173
174+ - name : Upload installer log
175+ if : always() && steps.setup-windows-sdk.outputs.log-file != ''
176+ uses : actions/upload-artifact@v4
177+ with :
178+ name : windows-sdk-installer-log-${{ github.job }}
179+ path : ${{ steps.setup-windows-sdk.outputs.log-file }}
180+
173181 - name : Install Windows MSVC version ${{ inputs.msvc-version }}
174182 if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.msvc-version != ''
175183 id : setup-msvc
@@ -212,6 +220,9 @@ runs:
212220 "--add", "Microsoft.VisualStudio.Component.VC.${MSVCPackageVersion}.ATL.ARM64"
213221 $process.WaitForExit()
214222
223+ $LogFile = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
224+ "log-file=$($LogFile.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
225+
215226 # Check if the MSVC version was installed successfully.
216227 $MSVCBuildToolsVersion = ""
217228 foreach ($dir in Get-ChildItem -Path $MSVCDir -Directory) {
@@ -224,16 +235,20 @@ runs:
224235 }
225236
226237 if ($MSVCBuildToolsVersion -eq "") {
227- Write-Output "::error::Failed to install MSVC ${MSVCVersionString}."
228- Write-Output "Installer log:"
229- $log = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
230- Get-Content $log.FullName
238+ Write-Output "::error::Failed to install MSVC ${MSVCVersionString}. Check the installer log for details."
231239 exit 1
232240 } else {
233241 Write-Output "ℹ️ MSVC ${MSVCBuildToolsVersion} installed successfully."
234242 "windows-build-tools-version=${MSVCBuildToolsVersion}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
235243 }
236244
245+ - name : Upload installer log
246+ if : always() && steps.setup-msvc.outputs.log-file != ''
247+ uses : actions/upload-artifact@v4
248+ with :
249+ name : msvc-installer-log-${{ github.job }}
250+ path : ${{ steps.setup-msvc.outputs.log-file }}
251+
237252 - name : Setup Visual Studio Developer Environment
238253 if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.setup-vs-dev-env == 'true'
239254 uses : compnerd/gha-setup-vsdevenv@5eb3eae1490d4f7875d574c4973539f69109700d # main
0 commit comments