CubeSandbox icon indicating copy to clipboard operation
CubeSandbox copied to clipboard

ci: add Python SDK publish workflow with version validation

Open wbzdssm opened this issue 5 months ago • 0 comments

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.toml version AND cubesandbox/__init__.py __version__ — fails fast if mismatched
  • Change detection: compares against previous python-sdk-v* tag (not v*), only publishes when sdk/python/ has actual changes

Workflow steps

  1. Triggered on python-sdk-v* tag push
  2. Strong version check: extract version from tag, compare with pyproject.toml and __init__.py — exit 1 on mismatch
  3. Change detection: diff sdk/python/ since last python-sdk-v* tag — skip if no changes
  4. Run tests (pytest)
  5. Build package (python -m build)
  6. Validate (twine check)
  7. 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

wbzdssm avatar Jul 01 '26 12:07 wbzdssm