Skip to content

livery.workshop._publish_entry

livery.workshop._publish_entry

Isolated Tier 1 entry point for the release publish job.

Invoked as python3 -I -m livery.workshop._publish_entry --ref=<sha> inside an isolated environment holding pinned livery-workshop alone. Never runs setup.sh, never imports tasks.py, never folds .repo.env, and never installs non-privileged workspace members. Verifies SHA-256 digests of the prebuilt distributions collected from the unprivileged build job, uploads them with uv publish, waits for the index to serve each version, and cuts the receipt tags.

Functions:

Name Description
main

CLI entry point for python3 -I -m livery.workshop._publish_entry.

main

main(argv: Sequence[str] | None = None) -> int

CLI entry point for python3 -I -m livery.workshop._publish_entry.

Source code in packages/workshop/src/livery/workshop/_publish_entry.py
def main(argv: Sequence[str] | None = None) -> int:
    """CLI entry point for ``python3 -I -m livery.workshop._publish_entry``."""
    parser = argparse.ArgumentParser(
        prog="livery.workshop._publish_entry",
        description="Verify prebuilt release distributions and publish in isolation.",
    )
    parser.add_argument(
        "--root",
        default=".",
        help="workspace root directory (default: current directory)",
    )
    parser.add_argument(
        "--ref",
        default="",
        help="release squash commit to publish (default: HEAD)",
    )
    parsed = parser.parse_args(list(argv) if argv is not None else None)
    try:
        receipts = isolated_publish_release(
            Path(parsed.root).resolve(),
            ref=parsed.ref
            or os.environ.get("TARGET_REF", "")
            or os.environ.get("ref", ""),  # noqa: SIM112
            token=os.environ.get("UV_PUBLISH_TOKEN", ""),
        )
    except Failed as error:
        print(f"publish: {error}", file=sys.stderr)
        return 1
    print(f"  wave: {len(receipts)} member(s) published")
    return 0