games.json now names game packages; each package lists its apps in its own apps.json, with the cover art, caption and action the library shows. Arcade packs every declared app generically, opens it directly from its cover, and builds a package's standalone collection from the same declaration. Standalone Shovey now starts on its covers like Arcade. Apps opened from a cover fill the screen with their own navigation; Profile stays on the covers. Bundles, the collection and the Apps controller are .zx on Ziran 0.3.1, with the reviewed controller from Apps 12e52c0. Parallel builds of Arcade and standalone Shovey now take turns building their shared liboqs instead of configuring it at the same time.
39 lines
2.1 KiB
Python
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.zx').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)
|