From 9c53668c846fa86b2783dab064ef3a8b21ad2292 Mon Sep 17 00:00:00 2001 From: key Date: Wed, 29 Jul 2026 12:43:48 +0800 Subject: [PATCH] fix(release): stamp current package in audit snapshot --- scripts/package-aug1-release.ps1 | 10 ++++++++++ scripts/tests/package-aug1-release.test.ps1 | 2 ++ 2 files changed, 12 insertions(+) diff --git a/scripts/package-aug1-release.ps1 b/scripts/package-aug1-release.ps1 index 1e860ea3..561ef172 100644 --- a/scripts/package-aug1-release.ps1 +++ b/scripts/package-aug1-release.ps1 @@ -222,6 +222,16 @@ try { Copy-Item -LiteralPath $entry.Value -Destination $destination } + $stagedGoNoGoPath = Join-Path $stagingDirectory 'operations\go-no-go.md' + $goNoGoText = Get-Content -Raw -Encoding UTF8 -LiteralPath $stagedGoNoGoPath + $goNoGoPackageLinePattern = '(?m)^\|[^\r\n]*output/aug1-release/bangdao-aug1-[^\r\n]*$' + if (-not [regex]::IsMatch($goNoGoText, $goNoGoPackageLinePattern)) { + throw 'Go/No-Go snapshot does not contain the release-package table row.' + } + $goNoGoPackageLine = "| Release package snapshot | ``output/aug1-release/$packageName``; runtime ``$runtimeShort``; operations ``$operationsShort``. ZIP byte size and SHA-256 are external verification facts because an archive cannot embed its own final hash. |" + $goNoGoText = [regex]::Replace($goNoGoText, $goNoGoPackageLinePattern, $goNoGoPackageLine, 1) + Write-Utf8 -Path $stagedGoNoGoPath -Content $goNoGoText + $readme = @( '# Bangdao August 1 Android controlled-test release package', '', diff --git a/scripts/tests/package-aug1-release.test.ps1 b/scripts/tests/package-aug1-release.test.ps1 index 6c2d8c16..5ce2c568 100644 --- a/scripts/tests/package-aug1-release.test.ps1 +++ b/scripts/tests/package-aug1-release.test.ps1 @@ -24,6 +24,8 @@ $requiredFragments = @( "'operations/go-no-go.md'", "'operations/business-content-and-five-channel-signoff.md'", 'Release package already exists and will not be overwritten', + 'Go/No-Go snapshot does not contain the release-package table row', + 'archive cannot embed its own final hash', 'Release package expected 20 files', 'ZIP verification expected 20 entries', 'ZIP entry hash mismatch',