🐍 orchestkit-hook-contract → PyPI publish workflow

Tag-driven release pipeline for the Python sibling package. Pattern adapted from Yonatan-HQ/core's publish-python.yml; simplified for public PyPI + OIDC trusted publishing.

Pipeline shape

     git tag hook-contract-py/v0.1.0
              │
              ▼
     ┌──────────────────────┐
     │ preflight            │  • tag regex match
     │                      │  • tag version == pyproject version
     │                      │  • codegen --check passes
     └──────────┬───────────┘
                ▼
     ┌──────────────────────┐
     │ build                │  • python -m build (hatchling)
     │                      │  • emits wheel + sdist
     │                      │  • sha256 + size to step summary
     └──────────┬───────────┘
                ▼
     ┌──────────────────────┐
     │ test                 │  • pytest -v on built source tree
     │                      │    (82 cases must all pass)
     └──────────┬───────────┘
                ▼
     ┌──────────────────────┐
     │ publish-testpypi     │  • OIDC trusted publishing
     │                      │  • environment: testpypi
     └──────────┬───────────┘
                ▼
     ┌──────────────────────┐
     │ smoke-testpypi       │  • wait for CDN propagation (poll)
     │                      │  • fresh ubuntu, fresh python
     │                      │  • pip install from test.pypi.org
     │                      │  • import + assert 19 events
     │                      │  • Pydantic typed instantiation works
     └──────────┬───────────┘
                ▼
     ┌──────────────────────┐
     │ publish-pypi         │  • OIDC trusted publishing
     │                      │  • environment: pypi (production)
     └──────────┬───────────┘
                ▼
     ┌──────────────────────┐
     │ github-release       │  • gh release create
     │                      │  • wheel + sdist + SHA256SUMS as assets
     └──────────────────────┘

What it borrows from Yonatan-HQ/core

What it does DIFFERENTLY

Manual prerequisite (one-time setup)

Register orchestkit-hook-contract as a Trusted Publisher on PyPI and TestPyPI. See packages/hook-contract-py/RELEASING.md for the exact form fields.

FieldValue
PyPI project nameorchestkit-hook-contract
Owneryonatangross
Repositoryorchestkit
Workflow filenamepublish-hook-contract-py.yml
Environment (testpypi)testpypi
Environment (pypi)pypi

How to cut v0.1.0 after merge

$ # bump version (already 0.1.0 in pyproject, ready to ship)
$ git tag hook-contract-py/v0.1.0
$ git push origin hook-contract-py/v0.1.0
$ # watch CI at /actions/workflows/publish-hook-contract-py.yml
$ # when green: pip install orchestkit-hook-contract works for everyone

Unblocks