Files
horizon-airdef/tools/build_release.py
T
Ludovic Marie 0bc6c689da Site: link the host-a-server page from the nav and the README; retire the Fabric server starter
tools/server.py and docs/server-quickstart.txt are gone (horizon-server replaces them);
build_release.py builds only the client starter, and the docs point to docs/hosting.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 05:34:34 +02:00

43 lines
1.8 KiB
Python

#!/usr/bin/env python3
"""Create the downloadable client starter and hashes from original project artifacts. (The Java/Fabric server
starter is gone: horizon-server replaces it, docs/hosting.md.)"""
import hashlib
from pathlib import Path
try:
from . import build_pack
except ImportError:
import build_pack
ROOT = build_pack.ROOT
def main():
lock = build_pack.read_lock()
version = lock["pack_version"]
mod = ROOT / "dist" / f"horizon-{version}.jar"
if not mod.exists():
raise FileNotFoundError("Run tools/build_mod.py first")
packs = [build_pack.build(profile, mod) for profile in build_pack.PROFILES]
client = {pack.name: pack.read_bytes() for pack in packs}
client["START-HERE.txt"] = (ROOT / "packs/START-HERE.txt").read_text().replace("@PACK_VERSION@", version).encode()
client["Mac-Start.command"] = (ROOT / "packs/Mac-Start.command").read_text().replace("@PACK_VERSION@", version).encode()
client["LICENSE"] = (ROOT / "LICENSE").read_bytes()
viewer = (ROOT / "tools/Compare-Benchmarks.html").read_bytes()
client["Compare-Benchmarks.html"] = viewer
(ROOT / "dist/Compare-Benchmarks.html").write_bytes(viewer)
build_pack.write_zip(ROOT / "dist" / f"horizon-mac-starter-{version}.zip", client)
artifacts = sorted(path for path in (ROOT / "dist").glob("*") if version in path.name)
artifacts.append(ROOT / "dist/Compare-Benchmarks.html")
checksums = []
for path in artifacts:
if path.suffix in [".jar", ".mrpack", ".zip", ".html"]:
checksums.append(hashlib.sha256(path.read_bytes()).hexdigest() + " " + path.name)
(ROOT / "dist/SHA256SUMS.txt").write_text("\n".join(checksums) + "\n")
print("Built the client starter and SHA256SUMS.txt")
if __name__ == "__main__":
main()