@@ -136,6 +136,7 @@ runs:
136136 -PassThru `
137137 -ArgumentList "modify", `
138138 "--noUpdateInstaller", `
139+ "--log", "${env:TEMP}\vs_installer_log_winsdk.log", `
139140 "--installPath", "`"$InstallPath`"", `
140141 "--channelId", "https://aka.ms/vs/17/release/channel", `
141142 "--quiet", "--norestart", "--nocache", `
@@ -146,8 +147,6 @@ runs:
146147 Write-Output "ℹ️ Windows SDK ${WinSdkVersionString} installed successfully."
147148 } else {
148149 Write-Output "::error::Failed to install Windows SDK ${WinSdkVersionString}. Check the installer log for details."
149- $LogFile = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
150- "log-file=$($LogFile.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
151150 exit 1
152151 }
153152 }
@@ -172,11 +171,11 @@ runs:
172171 }
173172
174173 - name : Upload installer log
175- if : always() && steps.setup-windows-sdk.outputs.log-file != ' '
174+ if : always() && steps.setup-windows-sdk.outcome == 'failure '
176175 uses : actions/upload-artifact@v4
177176 with :
178177 name : ${{ github.job }}-windows-sdk-installer-log
179- path : ${{ steps.setup-windows-sdk.outputs.log-file }}
178+ path : ${{ env.TEMP }}/vs_installer_log_winsdk.log"
180179
181180 - name : Install Windows MSVC version ${{ inputs.msvc-version }}
182181 if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.msvc-version != ''
@@ -234,20 +233,18 @@ runs:
234233
235234 if ($MSVCBuildToolsVersion -eq "") {
236235 Write-Output "::error::Failed to install MSVC ${MSVCVersionString}. Check the installer log for details."
237- $LogFile = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
238- "log-file=$($LogFile.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
239236 exit 1
240237 } else {
241238 Write-Output "ℹ️ MSVC ${MSVCBuildToolsVersion} installed successfully."
242239 "windows-build-tools-version=${MSVCBuildToolsVersion}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
243240 }
244241
245242 - name : Upload installer log
246- if : always() && steps.setup-msvc.outputs.log-file != ' '
243+ if : always() && steps.setup-msvc.outcome == 'failure '
247244 uses : actions/upload-artifact@v4
248245 with :
249246 name : ${{ github.job }}-msvc-installer-log
250- path : ${{ steps.setup-msvc.outputs.log-file }}
247+ path : ${{ env.TEMP }}/vs_installer_log_msvc.log"
251248
252249 - name : Setup Visual Studio Developer Environment
253250 if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.setup-vs-dev-env == 'true'
0 commit comments