CubeSandbox
CubeSandbox copied to clipboard
ci: add Python SDK publish workflow with version validation
Summary
Add .github/workflows/publish-python-sdk.yml to automate publishing the Python SDK to PyPI.
Changes from PR #638
- Trigger:
v*→python-sdk-v*(dedicated Python SDK version tag, decoupled from repo-level tags) - Version validation: tag version must match
pyproject.tomlversion ANDcubesandbox/__init__.py__version__— fails fast if mismatched - Change detection: compares against previous
python-sdk-v*tag (notv*), only publishes whensdk/python/has actual changes
Workflow steps
- Triggered on
python-sdk-v*tag push - Strong version check: extract version from tag, compare with
pyproject.tomland__init__.py— exit 1 on mismatch - Change detection: diff
sdk/python/since lastpython-sdk-v*tag — skip if no changes - Run tests (pytest)
- Build package (
python -m build) - Validate (
twine check) - Publish to PyPI
Required secrets
CUBE_PYPI_TOKEN— PyPI upload token
Tag convention
Use tags like python-sdk-v0.3.0 where 0.3.0 matches the version in pyproject.toml.
Closes #638