Gate site-specific limited release on five exact approvals and verified frozen export bytes

This commit is contained in:
huncode committed 2026-10-26 19:50:48 +03:00
1 parent 2676e474a1
commit f2494e8d1f
4 files changed
+72 -4

No files matched your search

+53 -1
View File
@@ -38,6 +38,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node for build
uses: actions/setup-node@v4
@@ -81,6 +83,46 @@ jobs:
COMMIT_SHA: ${{ github.sha }}
run: npm run ci:quality
- name: Restore exact five-role reviewed limited export
shell: bash
run: |
set -euo pipefail
manifest=docs/rebuild-v2/releases/current.json
test -f "$manifest"
python3 deploy/release-artifact.py verify --manifest "$manifest" --restore --tree web-front/out
python3 - <<'PYIDENTITY' >> "$GITHUB_ENV"
import json
data = json.load(open('docs/rebuild-v2/releases/current.json'))
print('REVIEWED_SOURCE_COMMIT=' + data['sourceCommit'])
print('REVIEWED_EXPORT_SHA=' + data['exportManifestSha256'])
PYIDENTITY
- name: Verify published corpus without claiming complete history
shell: bash
run: |
set -euo pipefail
python3 -S scripts/rebuild-v2/verify-vendor.py
node scripts/rebuild-v2/check-raster-sharp.mjs
python3 deploy/serve-local.py > "${RUNNER_TEMP}/videoreg-limited-preview.log" 2>&1 &
preview_pid=$!
trap 'kill "$preview_pid" 2>/dev/null || true' EXIT
base=$(python3 - "$preview_pid" <<'PYREADY'
import json, pathlib, sys, time, urllib.request
for attempt in range(50):
try:
state = json.loads(pathlib.Path('.local-run/server.json').read_text())
if state['pid'] == int(sys.argv[1]):
with urllib.request.urlopen(state['url'] + '/health/ready', timeout=1) as response:
if response.status == 200:
print(state['url']); break
except (OSError, ValueError, KeyError):
pass
time.sleep(0.1)
else:
raise SystemExit('Reviewed preview did not become ready')
PYREADY
)
python3 deploy/verify-published-corpus.py --manifest docs/rebuild-v2/releases/current.json --base "$base" --report "${RUNNER_TEMP}/videoreg-limited-fresh-crawl.json"
- name: Verify static output
shell: bash
run: |
@@ -103,7 +145,14 @@ jobs:
- name: Build static image
shell: bash
run: docker build --pull --tag "${IMAGE}" .
run: |
set -euo pipefail
docker build --pull --platform linux/amd64 --label "org.opencontainers.image.revision=${REVIEWED_SOURCE_COMMIT}" --label "me.videoreg.export-sha256=${REVIEWED_EXPORT_SHA}" --label "me.videoreg.delivery-commit=${GITHUB_SHA}" --label "me.videoreg.scope=reviewed-corpus-only" --tag "${IMAGE}" .
test "$(docker image inspect "$IMAGE" --format '{{.Architecture}}')" = amd64
docker run --rm --entrypoint nginx "$IMAGE" -t
cid=$(docker create "$IMAGE")
trap 'docker rm -f "$cid" >/dev/null 2>&1 || true' EXIT
docker cp "$cid:/usr/share/nginx/html/." - | python3 deploy/release-artifact.py image-tar --manifest docs/rebuild-v2/releases/current.json
- name: Push static image
shell: bash
@@ -112,6 +161,9 @@ jobs:
docker push "${IMAGE}"
docker tag "${IMAGE}" "${IMAGE_REPO}:latest"
docker push "${IMAGE_REPO}:latest"
digest=$(docker image inspect "$IMAGE" --format '{{index .RepoDigests 0}}')
[[ "$digest" =~ @sha256:[a-f0-9]{64}$ ]]
echo "IMAGE=$digest" >> "$GITHUB_ENV"
- name: Configure remote Docker
shell: bash