Skip to content

Commit b649e71

Browse files
BenKoncsikclaude
andcommitted
CI: fail loudly when no MSBuild is found for the VS VSIX; detect Build Tools
The build-vs-vsix job silently skipped ('No Visual Studio with MSBuild found') and still went green, so no VS VSIX was attached/published since 2.0.95. vswhere ignores Build Tools without -products *, so add it plus a fallback scan, and throw instead of skipping. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent bf4ad0f commit b649e71

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -536,26 +536,32 @@ jobs:
536536
- name: Build VS 2022 VSIX
537537
shell: powershell
538538
run: |
539+
# Fail LOUDLY if no MSBuild is found: a silent skip used to leave the
540+
# release without a VS VSIX while the job still showed green.
539541
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
540542
if (-not (Test-Path $vswhere)) {
541-
Write-Warning "vswhere.exe not found - skipping."
542-
exit 0
543+
throw "vswhere.exe not found on this runner - cannot build the VS VSIX."
543544
}
544545
# A VSIX-et a Microsoft.VSSDK.BuildTools NuGet buildeli, ezért bármelyik
545546
# MSBuild jó (a manifest install-target [17.0,19.0) VS 2022 + VS 2026).
546-
# A runner image VS 2022-t VAGY VS 2026-ot tartalmazhat, ezért tág a
547-
# tartomány és a -prerelease is kell (a VS 2026 prerelease-ként jelölt).
548-
$path = & $vswhere -version "[17.0,19.0)" -latest -prerelease `
547+
# `-products *` kell, különben a vswhere kihagyja a Build Tools-t;
548+
# -prerelease a VS 2026 miatt.
549+
$path = & $vswhere -products * -version "[17.0,19.0)" -latest -prerelease `
549550
-requires Microsoft.Component.MSBuild `
550551
-property installationPath
551552
if (-not $path) {
552-
Write-Warning "No Visual Studio with MSBuild found - skipping."
553-
exit 0
553+
# Fallback: any installed instance that ships MSBuild.exe.
554+
$path = & $vswhere -products * -prerelease -all -property installationPath |
555+
Where-Object { Test-Path (Join-Path $_ "MSBuild\Current\Bin\MSBuild.exe") } |
556+
Select-Object -First 1
557+
}
558+
if (-not $path) {
559+
& $vswhere -products * -prerelease -all
560+
throw "No Visual Studio / Build Tools with MSBuild found on this runner."
554561
}
555562
$msbuild = Join-Path $path "MSBuild\Current\Bin\MSBuild.exe"
556563
if (-not (Test-Path $msbuild)) {
557-
Write-Warning "MSBuild.exe not found at $msbuild - skipping."
558-
exit 0
564+
throw "MSBuild.exe not found at $msbuild."
559565
}
560566
Write-Host "MSBuild: $msbuild"
561567
# Two-pass build: Restore must complete in its own invocation so that the
@@ -575,8 +581,7 @@ jobs:
575581
if ($LASTEXITCODE -ne 0) { throw "MSBuild Rebuild failed ($LASTEXITCODE)" }
576582
$built = "vs\bin\Release\RevisionGraph.vsix"
577583
if (-not (Test-Path $built)) {
578-
Write-Warning "VSIX not found at $built after build."
579-
exit 0
584+
throw "VSIX not found at $built after build."
580585
}
581586
New-Item -ItemType Directory -Force "dist\installers" | Out-Null
582587
Copy-Item $built "dist\installers\RevisionGraph-vs2022.vsix" -Force

0 commit comments

Comments
 (0)