@@ -101,25 +101,38 @@ jobs:
101101 }
102102
103103 - name : Build installer with Visual Studio
104+ id : build_installer
104105 shell : pwsh
105106 run : |
106- $devenv = (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property productPath).Trim()
107- if (-not $devenv) {
108- throw "devenv.exe was not found."
107+ # (260405Ch) Use devenv.com for command-line builds so the workflow waits for vdproj build completion and captures logs.
108+ $devenvExe = (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property productPath).Trim()
109+ if (-not $devenvExe) {
110+ throw "Visual Studio was not found."
109111 }
110112
111- & $devenv "ReciPro.sln" /Build "Release|x64" /Project "ReciProSetup\ReciProSetup.vdproj"
113+ $devenvCli = [System.IO.Path]::ChangeExtension($devenvExe, ".com")
114+ if (-not (Test-Path $devenvCli)) {
115+ throw "devenv.com was not found next to $devenvExe."
116+ }
117+
118+ $buildLogPath = Join-Path $env:RUNNER_TEMP "devenv-build.log"
119+ & $devenvCli "ReciPro.sln" /Build "Release|x64" /Project "ReciProSetup" /Out $buildLogPath
120+ $buildExitCode = $LASTEXITCODE
112121
113- if ($LASTEXITCODE -ne 0) {
114- exit $LASTEXITCODE
122+ Write-Host "devenv exit code: $buildExitCode"
123+ if (Test-Path $buildLogPath) {
124+ Get-Content $buildLogPath
115125 }
116126
127+ "build_exit_code=$buildExitCode" >> $env:GITHUB_OUTPUT
128+ "build_log_path=$buildLogPath" >> $env:GITHUB_OUTPUT
129+
117130 - name : Confirm installer outputs
118131 id : installer_outputs
119132 shell : pwsh
120133 run : |
121134 # (260405Ch) Some environments materialize setup project outputs slightly after devenv returns, so wait and locate them dynamically.
122- $requiredNames = @("ReciProSetup.msi", "setup.exe" )
135+ $requiredNames = @("ReciProSetup.msi")
123136 $foundFiles = @{}
124137 $deadline = (Get-Date).AddMinutes(2)
125138
@@ -143,19 +156,26 @@ jobs:
143156 Where-Object { $_.Extension -eq ".msi" -or $_.Name -eq "setup.exe" } |
144157 Select-Object FullName, Length, LastWriteTime
145158
159+ if (Test-Path "${{ steps.build_installer.outputs.build_log_path }}") {
160+ Write-Host "devenv build log:"
161+ Get-Content "${{ steps.build_installer.outputs.build_log_path }}"
162+ }
163+
146164 throw "Required output was not found: $($missingFiles -join ', ')"
147165 }
148166
167+ if ("${{ steps.build_installer.outputs.build_exit_code }}" -ne "0") {
168+ Write-Warning "devenv returned exit code ${{ steps.build_installer.outputs.build_exit_code }}, but the MSI output was found. Continuing with the generated file."
169+ }
170+
149171 "msi_path=$($foundFiles['ReciProSetup.msi'])" >> $env:GITHUB_OUTPUT
150- "bootstrapper_path=$($foundFiles['setup.exe'])" >> $env:GITHUB_OUTPUT
151172
152173 - name : Upload workflow artifacts
153174 uses : actions/upload-artifact@v4
154175 with :
155176 name : ReciPro-installer-${{ github.ref_name }}
156177 path : |
157178 ${{ steps.installer_outputs.outputs.msi_path }}
158- ${{ steps.installer_outputs.outputs.bootstrapper_path }}
159179
160180 - name : Create GitHub Release
161181 shell : pwsh
@@ -164,7 +184,6 @@ jobs:
164184 run : |
165185 gh release create "${{ github.ref_name }}" `
166186 "${{ steps.installer_outputs.outputs.msi_path }}" `
167- "${{ steps.installer_outputs.outputs.bootstrapper_path }}" `
168187 --verify-tag `
169188 --title "${{ steps.version_info.outputs.release_title }}" `
170189 --notes-file "${{ steps.version_info.outputs.notes_path }}"
0 commit comments