Skip to content

chore(release): prepare v0.1.0 #1

chore(release): prepare v0.1.0

chore(release): prepare v0.1.0 #1

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 }}"