ci(welcome): fail the build if the Welcome payload isn't baked (guard against green-but-broken image)
Some checks failed
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Failing after 1m17s
Some checks failed
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Failing after 1m17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -155,6 +155,15 @@ function Copy-WelcomePayload {
|
||||
} else {
|
||||
Write-Warning " No *.json flavour files found in $flavoursDir -- image will ship with no flavours."
|
||||
}
|
||||
# --- Guard: verify the payload actually landed in the mounted image -------
|
||||
$stagedExe = Join-Path $dest 'SilverOS.Welcome.App.exe'
|
||||
if (-not (Test-Path $stagedExe)) {
|
||||
throw "Welcome bake failed: SilverOS.Welcome.App.exe missing from image (expected at '$stagedExe'). Check that dotnet publish produced the exe and Copy-Item succeeded."
|
||||
}
|
||||
$stagedFlavours = Get-ChildItem $destFlavours -Filter '*.json' -EA SilentlyContinue
|
||||
if (-not $stagedFlavours) {
|
||||
throw "Welcome bake failed: no flavour manifests staged in '$destFlavours'. Add *.json files under windows/flavours/ or the installed wizard will have no flavour choices."
|
||||
}
|
||||
Write-Host " Welcome payload staged at $dest"
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,14 @@ try {
|
||||
$mods = Get-ChildItem (Join-Path $mount 'Windows\Setup\Scripts\hardening') -Filter *.ps1 -EA SilentlyContinue
|
||||
Assert 'hardening modules baked (>=9 .ps1)' ($mods.Count -ge 9)
|
||||
Assert 'Verify script baked' (Test-Path (Join-Path $mount 'Windows\Setup\Scripts\hardening\Verify-SilverMetalWindows.ps1'))
|
||||
|
||||
# Welcome app payload assertions (skipped when Welcome is intentionally disabled).
|
||||
if ($env:SILVERMETAL_WELCOME_ENABLED -ne '0') {
|
||||
$welcomeExe = Join-Path $mount 'Program Files\SilverOS\Welcome\SilverOS.Welcome.App.exe'
|
||||
Assert 'Welcome exe baked into WIM' (Test-Path $welcomeExe)
|
||||
$welcomeFlavours = Get-ChildItem (Join-Path $mount 'Program Files\SilverOS\Welcome\flavours') -Filter '*.json' -EA SilentlyContinue
|
||||
Assert 'Welcome flavours baked (>=1 .json)' ($welcomeFlavours.Count -ge 1)
|
||||
}
|
||||
} finally { Dismount-WindowsImage -Path $mount -Discard | Out-Null }
|
||||
}
|
||||
} finally { Dismount-DiskImage -ImagePath $IsoPath | Out-Null }
|
||||
|
||||
Reference in New Issue
Block a user