Files
arcade/scripts/package-release.py
T
waozi f43c7d3a0d Publish Arcade's games with the Apps package's node publisher
scripts/package-release.py now runs Apps' scripts/node_release.py with
Arcade's ledger and bundles and the publisher pins released Inbe ships,
so publishing no longer waits for Inbe's newer publisher to be released.
Apps moves to 6b555be; its controller builds to the reviewed digest
e1f3536a.

The publisher test uploads only the release files, not the history the
node writes itself, and the catalog test accepts an Inbe release whose
ledger predates node apps.
2026-10-19 01:08:40 -03:00

39 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""Release Arcade-owned games through the Apps package's signed Daochi publisher."""
from pathlib import Path
from hashlib import sha256
import json
import subprocess
import sys
ROOT = Path(__file__).resolve().parents[1]
if __name__ == '__main__':
if '--ssh-target' in sys.argv or any(value.startswith('--ssh-target=') for value in sys.argv):
try:
receipt = json.loads((ROOT / 'build/compatibility.json').read_text())
component = json.loads((ROOT / 'apps/versions.json').read_text())['node_apps']['chess']
valid = all(receipt.get(key) == component[field] for key, field in
[('app_id', 'id'), ('version', 'version'), ('sequence', 'sequence')])
valid = valid and receipt.get('sha256') == sha256((ROOT / 'build/games/chess.zib').read_bytes()).hexdigest()
valid = valid and all(receipt.get(key) is True for key in
['arcade', 'inbe', 'oldest_inbe', 'rules', 'friend_protocol', 'rendering', 'save_restore'])
except (OSError, ValueError, KeyError):
valid = False
if not valid:
raise SystemExit('Node publication requires this exact Chess bundle to pass Arcade, intended Inbe and oldest supported Inbe checks')
flags = [] if (ROOT / 'ziran.local.toml').exists() else ['--locked']
def package(name):
return Path(subprocess.check_output(
[str(ROOT / 'scripts/ziran.sh'), 'pkg', 'path', name, *flags],
cwd=ROOT, text=True).strip())
# The publisher retains its signed IDs, release sequence checks and
# receiver; released Inbe's pins name the key that may sign node apps.
# Source and build outputs belong to Arcade.
command = [sys.executable, str(package('apps') / 'scripts/node_release.py'),
'--node-app', 'chess', '--app-ledger', str(ROOT / 'apps/versions.json'),
'--bundle-directory', str(ROOT / 'build/games'),
'--publishers', str(package('inbe') / 'apps/publishers.json'), *sys.argv[1:]]
raise SystemExit(subprocess.run(command, cwd=ROOT).returncode)