fix: include rendering gate in NAS manifest

This commit is contained in:
2026-07-18 14:40:35 +09:00
parent 134a509938
commit 4a2a0dfb19

View File

@@ -24,6 +24,34 @@ function Quote-Sh {
return "'" + ($Value -replace "'", "'\''") + "'"
}
function Get-ObjectPropertyValue {
param(
[object]$Object,
[string]$Name
)
if ($null -eq $Object) {
return $null
}
$property = $Object.PSObject.Properties[$Name]
if ($null -eq $property) {
return $null
}
return $property.Value
}
function Test-ReleaseManifestRenderingGate {
param([object]$Manifest)
$renderingGate = Get-ObjectPropertyValue $Manifest "renderingGate"
$viewport = Get-ObjectPropertyValue $renderingGate "viewport"
return (
(Get-ObjectPropertyValue $renderingGate "requiredRenderer") -eq "webgl" -and
(Get-ObjectPropertyValue $renderingGate "compatibilityRenderer") -eq "canvas" -and
(Get-ObjectPropertyValue $viewport "width") -eq 1920 -and
(Get-ObjectPropertyValue $viewport "height") -eq 1080 -and
(Get-ObjectPropertyValue $viewport "deviceScaleFactor") -eq 1
)
}
Assert-Command "ssh"
Assert-Command "scp"
Assert-Command "git"
@@ -64,9 +92,14 @@ if (Test-Path $releaseManifestPath -PathType Leaf) {
if ($existingReleaseManifest.app -ne "heros_web") {
throw "Existing release manifest has unexpected app '$($existingReleaseManifest.app)'."
}
if ($existingReleaseManifest.commit -eq $fullCommit) {
if (
$existingReleaseManifest.commit -eq $fullCommit -and
(Test-ReleaseManifestRenderingGate $existingReleaseManifest)
) {
$writeReleaseManifest = $false
Write-Host "Using existing $releaseManifestPath for $commit"
} elseif ($existingReleaseManifest.commit -eq $fullCommit) {
Write-Host "Replacing incomplete $releaseManifestPath for $commit"
} else {
Write-Host "Replacing stale $releaseManifestPath commit $($existingReleaseManifest.commit) with $commit"
}
@@ -81,6 +114,15 @@ if ($writeReleaseManifest) {
shortCommit = $commit
qaVersion = $qaVersion
generatedAt = (Get-Date).ToUniversalTime().ToString("o")
renderingGate = @{
requiredRenderer = "webgl"
compatibilityRenderer = "canvas"
viewport = @{
width = 1920
height = 1080
deviceScaleFactor = 1
}
}
} | ConvertTo-Json -Depth 4
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
[System.IO.File]::WriteAllText($releaseManifestPath, "$releaseManifestJson`n", $utf8NoBom)