Skip to content

Fix release workflow deps and bump to 1.0.2 #2

Fix release workflow deps and bump to 1.0.2

Fix release workflow deps and bump to 1.0.2 #2

Workflow file for this run

name: Release to PyPI
on:
push:
tags:
- "v*"
permissions:
contents: read
id-token: write
concurrency:
group: pypi-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Verify tag matches pyproject version
run: |
python - <<'PY'
import os
import sys
import tomllib
tag = os.environ.get("GITHUB_REF_NAME", "")
if not tag.startswith("v"):
print(f"Unexpected tag format: {tag!r}", file=sys.stderr)
raise SystemExit(1)
with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)
version = data["project"]["version"]
if tag[1:] != version:
print(f"Tag {tag!r} does not match pyproject version {version!r}", file=sys.stderr)
raise SystemExit(1)
print(f"OK: tag {tag} matches version {version}")
PY
- name: Install project (dev + transport extras for tests)
run: uv sync --extra dev --extra grpc --extra http --extra ws
- name: Run tests
run: uv run pytest -q
- name: Build distributions
run: uv build
- name: Publish to PyPI (Trusted Publishing)
uses: pypa/gh-action-pypi-publish@release/v1