@@ -108,6 +108,7 @@ runs:
108
108
109
109
- name : Install Windows SDK version ${{ inputs.windows-sdk-version }}
110
110
if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.windows-sdk-version != ''
111
+ id : setup-windows-sdk
111
112
shell : pwsh
112
113
run : |
113
114
$WinSdkVersionString = "${{ inputs.windows-sdk-version }}"
@@ -140,13 +141,13 @@ runs:
140
141
"--add", "Microsoft.VisualStudio.Component.Windows11SDK.${WinSdkVersionBuild}"
141
142
$process.WaitForExit()
142
143
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
+
143
147
if (Test-Path -Path $Win10SdkIncludeVersion -PathType Container) {
144
148
Write-Output "ℹ️ Windows SDK ${WinSdkVersionString} installed successfully."
145
149
} 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."
150
151
exit 1
151
152
}
152
153
}
@@ -170,6 +171,13 @@ runs:
170
171
}
171
172
}
172
173
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
+
173
181
- name : Install Windows MSVC version ${{ inputs.msvc-version }}
174
182
if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.msvc-version != ''
175
183
id : setup-msvc
@@ -212,6 +220,9 @@ runs:
212
220
"--add", "Microsoft.VisualStudio.Component.VC.${MSVCPackageVersion}.ATL.ARM64"
213
221
$process.WaitForExit()
214
222
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
+
215
226
# Check if the MSVC version was installed successfully.
216
227
$MSVCBuildToolsVersion = ""
217
228
foreach ($dir in Get-ChildItem -Path $MSVCDir -Directory) {
@@ -224,16 +235,20 @@ runs:
224
235
}
225
236
226
237
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."
231
239
exit 1
232
240
} else {
233
241
Write-Output "ℹ️ MSVC ${MSVCBuildToolsVersion} installed successfully."
234
242
"windows-build-tools-version=${MSVCBuildToolsVersion}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
235
243
}
236
244
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
+
237
252
- name : Setup Visual Studio Developer Environment
238
253
if : steps.sanitize-input.outputs.build-os == 'windows' && inputs.setup-vs-dev-env == 'true'
239
254
uses : compnerd/gha-setup-vsdevenv@5eb3eae1490d4f7875d574c4973539f69109700d # main
0 commit comments