Files
shoes/scripts/smoke-release.py
cfal c3453ef1ab Add ARMv7 release builds and verified artifact packaging (#239)
Add Linux ARMv7 hard-float GNU and static musl binaries so 32-bit ARMv7 systems can use prebuilt Shoes releases. Retain the six existing targets, pin build tooling and cross images, and validate each packaged binary with native or QEMU checks before uploading it. Harden future releases with version and tag validation, SHA-256 checksums, and GitHub build-provenance attestations, and document platform requirements and artifact verification.
2026-10-28 12:29:58 +08:00

36 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""Checks a packaged CLI, optionally through a cross-target runner."""
import argparse
from pathlib import Path
import subprocess
import tomllib
ROOT = Path(__file__).resolve().parents[1]
def smoke(command):
version = tomllib.loads((ROOT / "Cargo.toml").read_text())["package"]["version"]
result = subprocess.check_output([*command, "--version"], cwd=ROOT, timeout=60)
if result.strip() != f"shoes {version}".encode():
raise ValueError(f"Unexpected binary version: {result!r}")
subprocess.run(
[*command, "check", "--threads", "1", "examples/socks_basic.yaml"],
cwd=ROOT, check=True, timeout=60,
)
# Key generation exercises the target's native crypto implementation, not just CLI parsing.
subprocess.run(
[*command, "generate-reality-keypair"],
cwd=ROOT, check=True, timeout=60, stdout=subprocess.DEVNULL,
)
print("Packaged binary smoke passed")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("command", nargs=argparse.REMAINDER, help="binary command, including any runner")
args = parser.parse_args()
if not args.command:
parser.error("a binary command is required")
smoke(args.command)