Skip to content

v0.4.0

v0.4.0 #5

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
jobs:
verify-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check source version matches tag
run: |
TAG="${GITHUB_REF_NAME#v}"
SOURCE=$(python3 -c "exec(open('src/rdapapi/_version.py').read()); print(__version__)")
if [ "$TAG" != "$SOURCE" ]; then
echo "::error::Tag v$TAG does not match source version $SOURCE — bump _version.py first"
exit 1
fi
test:
needs: verify-version
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run tests
run: pytest -v
publish:
needs: test
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install build tools
run: pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0