fix(release): enforce the v1.8 What's New floor
Demo images / Build & push demo images (push) Failing after 39s
Demo images / Build & push demo images (push) Failing after 39s
This commit is contained in:
@@ -165,16 +165,35 @@ else
|
||||
sudo rm -rf "$TMPBIN"
|
||||
fi
|
||||
|
||||
# ── Frontend payload present ─────────────────────────────────────────
|
||||
if [ -f "$MNT/archipelago/web-ui/index.html" ]; then
|
||||
# ── Frontend + companion payload ─────────────────────────────────────
|
||||
WEB_UI="$MNT/archipelago/web-ui"
|
||||
if [ -f "$WEB_UI/index.html" ]; then
|
||||
ok "frontend payload (archipelago/web-ui/index.html)"
|
||||
if [ -f "$MNT/archipelago/web-ui/aiui/index.html" ]; then
|
||||
if [ -f "$WEB_UI/aiui/index.html" ]; then
|
||||
ok "AIUI included in frontend payload"
|
||||
else
|
||||
warn "AIUI missing from archipelago/web-ui (verify rootfs copy before shipping)"
|
||||
bad "AIUI missing from archipelago/web-ui"
|
||||
fi
|
||||
|
||||
COMPANION_META="$WEB_UI/packages/archipelago-companion.json"
|
||||
COMPANION_APK="$WEB_UI/packages/archipelago-companion.apk"
|
||||
if [ -s "$COMPANION_APK" ] && [ "$(jq -r '.versionName // empty' "$COMPANION_META" 2>/dev/null)" = "0.5.28" ] \
|
||||
&& [ "$(jq -r '.versionCode // empty' "$COMPANION_META" 2>/dev/null)" = "48" ]; then
|
||||
ok "Companion 0.5.28 (versionCode 48) APK included"
|
||||
else
|
||||
bad "Companion 0.5.28 APK/metadata missing or stale"
|
||||
fi
|
||||
|
||||
SETTINGS_BUNDLE="$(grep -rlF "v$EXPECTED_VERSION" "$WEB_UI/assets" 2>/dev/null | head -1)"
|
||||
if [ -n "$SETTINGS_BUNDLE" ] \
|
||||
&& grep -qF 'v1.8.0-alpha' "$SETTINGS_BUNDLE" \
|
||||
&& ! grep -qE 'v1\.[0-7]\.|v1\.2\.0-alpha' "$SETTINGS_BUNDLE"; then
|
||||
ok "What's New is v1.8.6-first with a v1.8.0 history floor"
|
||||
else
|
||||
bad "What's New payload is missing v1.8 history or still contains pre-v1.8 entries"
|
||||
fi
|
||||
else
|
||||
warn "no archipelago/web-ui payload on ISO (frontend may live in rootfs.tar only)"
|
||||
bad "no archipelago/web-ui payload on ISO"
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
@@ -73,10 +73,15 @@ def undated_versions():
|
||||
|
||||
|
||||
def ordered_versions():
|
||||
"""Return modal versions in display order (top to bottom)."""
|
||||
"""Return generated modal versions in display order (top to bottom)."""
|
||||
return re.findall(r"<!-- (v\d+\.\d+\.\d+\S*) -->", MODAL.read_text())
|
||||
|
||||
|
||||
def legacy_blocks():
|
||||
"""Return old hand-written alpha blocks that predate generated markers."""
|
||||
return re.findall(r"<!-- (alpha\.[^ ]+) -->", MODAL.read_text())
|
||||
|
||||
|
||||
def version_key(version):
|
||||
match = re.match(r"v(\d+)\.(\d+)\.(\d+)", version)
|
||||
return tuple(map(int, match.groups()))
|
||||
@@ -85,7 +90,10 @@ def version_key(version):
|
||||
def sort_modal_blocks(entries):
|
||||
"""Re-render current release-note blocks newest-first and remove old history."""
|
||||
lines = MODAL.read_text().splitlines(keepends=True)
|
||||
marker = re.compile(r"^\s*<!-- (v\d+\.\d+\.\d+\S*) -->\s*$")
|
||||
# Include the old hand-written `alpha.*` blocks in the replace range so
|
||||
# normalization can delete them. Previously the checker saw only generated
|
||||
# vX.Y.Z markers and falsely claimed the v1.8.0 history floor was enforced.
|
||||
marker = re.compile(r"^\s*<!-- ((?:v\d+\.\d+\.\d+\S*)|(?:alpha\.[^ ]+)) -->\s*$")
|
||||
blocks = []
|
||||
|
||||
for start, line in enumerate(lines):
|
||||
@@ -115,7 +123,10 @@ def sort_modal_blocks(entries):
|
||||
raise RuntimeError("unexpected content between What's New release blocks")
|
||||
|
||||
by_version = {entry["ver"]: entry for entry in entries}
|
||||
retained = [b for b in blocks if version_key(b[2]) >= MIN_VISIBLE_VERSION]
|
||||
retained = [
|
||||
b for b in blocks
|
||||
if b[2].startswith("v") and version_key(b[2]) >= MIN_VISIBLE_VERSION
|
||||
]
|
||||
sorted_segments = [
|
||||
render_block(by_version[b[2]]).splitlines(keepends=True)
|
||||
if b[2] in by_version else b[3]
|
||||
@@ -181,6 +192,7 @@ def main():
|
||||
expected_order = sorted(displayed, key=version_key, reverse=True)
|
||||
out_of_order = displayed != expected_order
|
||||
too_old = [v for v in displayed if version_key(v) < MIN_VISIBLE_VERSION]
|
||||
too_old.extend(legacy_blocks())
|
||||
|
||||
if not missing and not out_of_order and not too_old:
|
||||
changed = False if check else sort_modal_blocks(entries)
|
||||
|
||||
Reference in New Issue
Block a user