chore(release): prepare v0.1.0 #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Python SDK | |
| on: | |
| push: | |
| tags: | |
| - "sdk-python-v*.*.*" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Verify tag matches package version | |
| run: | | |
| python - <<'PY' | |
| import os | |
| from pathlib import Path | |
| import tomllib | |
| tag_version = os.environ["GITHUB_REF_NAME"].removeprefix("sdk-python-v") | |
| pyproject = tomllib.loads(Path("sdk/python/pyproject.toml").read_text()) | |
| package_version = pyproject["project"]["version"] | |
| if tag_version != package_version: | |
| raise SystemExit( | |
| f"tag version {tag_version} does not match pyproject version {package_version}" | |
| ) | |
| PY | |
| - name: Build distributions | |
| working-directory: sdk/python | |
| run: | | |
| python -m pip install --upgrade build | |
| python -m build | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: sdk/python/dist | |
| - name: Delete tag on failure | |
| if: failure() | |
| run: git push --delete origin "${{ github.ref_name }}" |