Skip to content

v0.9.3 — redesigned TUI #23

v0.9.3 — redesigned TUI

v0.9.3 — redesigned TUI #23

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
jobs:
validate:
name: Validate release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Check tag matches code version
run: |
TAG="${GITHUB_REF#refs/tags/v}"
CODE_VERSION=$(python -c "
import re
with open('pyproject.toml') as f:
match = re.search(r'^version\s*=\s*\"(.+?)\"', f.read(), re.MULTILINE)
print(match.group(1))
")
echo "Git tag version: $TAG"
echo "Code version: $CODE_VERSION"
if [ "$TAG" != "$CODE_VERSION" ]; then
echo "::error::Tag v$TAG does not match code version $CODE_VERSION"
exit 1
fi
- name: Lint
run: ruff check .
- name: Run tests
run: pytest -v
publish:
name: Publish to PyPI
needs: validate
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1