Skip to content

feat: regenerate for OpenAPI 0.110.1 (Dataset feature, dataset-backed… #9

feat: regenerate for OpenAPI 0.110.1 (Dataset feature, dataset-backed…

feat: regenerate for OpenAPI 0.110.1 (Dataset feature, dataset-backed… #9

Workflow file for this run

name: Publish
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
# OIDC trusted publishing — no PYPI_TOKEN secret required. The PyPI side
# must register github.com/QTSurfer/api-client-python as a trusted
# publisher for the project named `qtsurfer-api-client` (one-time setup).
jobs:
publish:
name: build + publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/qtsurfer-api-client
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python 3.12
run: uv python install 3.12
- name: Sync dependencies
run: uv sync --frozen
- name: Verify tag matches pyproject.toml version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PYPROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.loads(open('pyproject.toml','rb').read().decode())['project']['version'])")
echo "tag: $TAG_VERSION"
echo "pyproject: $PYPROJECT_VERSION"
if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
echo "::error::Tag ($TAG_VERSION) does not match pyproject.toml version ($PYPROJECT_VERSION)."
exit 1
fi
- name: Fetch openapi.yaml
run: curl -fsSL https://raw.githubusercontent.com/QTSurfer/qtsurfer.github.io/main/openapi.yaml -o openapi.yaml
- name: Build
run: uv run python -m build
- name: Twine check
run: uv run twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
release:
name: GitHub Release
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
# The notes are the CHANGELOG section verbatim, so whatever is written there ships to
# readers as the release. The tag carries a leading `v` and the heading does not.
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${GITHUB_REF_NAME#v}"
awk "/^## \[${VERSION}\]/{found=1; print; next} found && /^## \[/{exit} found{print}" \
CHANGELOG.md > /tmp/release-notes.md
if [ ! -s /tmp/release-notes.md ]; then
echo "No CHANGELOG section for ${VERSION}; refusing to publish an empty release." >&2
exit 1
fi
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes-file /tmp/release-notes.md