fix(release): verify TUI materials before tagging

This commit is contained in:
Xubin Ren committed 2026-09-16 01:30:47 +08:00
1 parent ea630c7303
commit d24ae06117
5 files changed
+111 -15

No files matched your search

+3 -2
View File
@@ -2,7 +2,7 @@
The nanobot TUI release archive contains the executable, its complete JavaScript/TypeScript
application source, dependency lockfile, build scripts, and third-party notices. It is built with
Bun 1.3.13 and OpenTUI 0.5.3. See `SOURCE_OFFER.md` for the corresponding-source
Bun 1.3.13 and OpenTUI 0.5.10. See `SOURCE_OFFER.md` for the corresponding-source
offer that accompanies the executable. The archive also contains the complete LGPL 2.0 and
LGPL 2.1 license texts.
@@ -13,7 +13,8 @@ Corresponding upstream source:
<https://github.com/oven-sh/bun/tree/bun-v1.3.13>
- Bun's patched WebKit (`4d5e75ebd84a14edbc7ae264245dcd77fe597c10`):
<https://github.com/oven-sh/WebKit/tree/4d5e75ebd84a14edbc7ae264245dcd77fe597c10>
- OpenTUI 0.5.3: <https://www.npmjs.com/package/@opentui/core/v/0.5.3>
- OpenTUI 0.5.10: <https://www.npmjs.com/package/@opentui/core/v/0.5.10>
(source: <https://github.com/anomalyco/opentui/tree/f6673a04ccb671b9207da358c57152bfd27c781f>)
To rebuild against a modified JavaScriptCore/WebKit, first build Bun 1.3.13 from its complete
source checkout together with the WebKit revision above by following Bun's pinned license and
+19 -1
View File
@@ -4,6 +4,8 @@ from __future__ import annotations
import hashlib
import io
import json
import re
import sys
import tarfile
import zipfile
@@ -22,6 +24,20 @@ def _sha256(data: bytes) -> str:
return hashlib.sha256(data).hexdigest()
def _validate_opentui_version(root: Path, notices: str) -> None:
version = json.loads((root / "package.json").read_text())["dependencies"]["@opentui/core"]
if not re.fullmatch(r"\d+\.\d+\.\d+", version):
raise ValueError("OpenTUI must be pinned to an exact release version")
relinking = (root / "RELINKING.md").read_text()
if (
set(re.findall(r"OpenTUI (\d+\.\d+\.\d+)", relinking)) != {version}
or f"https://www.npmjs.com/package/@opentui/core/v/{version}>" not in relinking
):
raise ValueError(f"RELINKING.md must describe OpenTUI {version}")
if f"===== @opentui/core {version} (" not in notices:
raise ValueError(f"third-party notices must describe OpenTUI {version}")
def _source_archive(root: Path) -> bytes:
included = [
"README.md",
@@ -61,10 +77,12 @@ def main() -> None:
extension = ".exe" if target.startswith("win32-") else ""
asset = f"nanobot-tui-{target}{extension}"
dist = root / "dist"
notices = (dist / f"{asset}.THIRD_PARTY_NOTICES.txt").read_bytes()
_validate_opentui_version(root, notices.decode("utf-8"))
files = {
asset: (dist / asset).read_bytes(),
"THIRD_PARTY_NOTICES.txt": (dist / f"{asset}.THIRD_PARTY_NOTICES.txt").read_bytes(),
"THIRD_PARTY_NOTICES.txt": notices,
"RELINKING.md": (root / "RELINKING.md").read_bytes(),
"SOURCE_OFFER.md": (root / "SOURCE_OFFER.md").read_bytes(),
"LICENSE": (project_root / "LICENSE").read_bytes(),