feat(release): define commit-addressed bundle index

This commit is contained in:
2026-07-27 17:00:56 +00:00
committed by didericis
parent b3834ebf66
commit 9eab5be2c4
3 changed files with 217 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
"""Generate the external commit-addressed release bundle index."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
from bot_bottle.release_bundle import build_bundle_index, canonical_bytes
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--manifest", required=True, type=Path)
parser.add_argument("--wheel", required=True, type=Path)
parser.add_argument("--wheel-url", required=True)
parser.add_argument("--workflow-run", required=True)
parser.add_argument("--published-at", required=True)
parser.add_argument("--output", required=True, type=Path)
args = parser.parse_args(argv)
manifest = json.loads(args.manifest.read_text(encoding="utf-8"))
index = build_bundle_index(
manifest,
wheel=args.wheel,
wheel_url=args.wheel_url,
workflow_run=args.workflow_run,
published_at=args.published_at,
)
args.output.write_bytes(canonical_bytes(index))
return 0
if __name__ == "__main__":
raise SystemExit(main())