Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: CI
on:
push:
pull_request:
release:
types: [published]
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -77,3 +79,30 @@ jobs:
name: corpus-report
path: ${{ runner.temp }}/corpus-report/
if-no-files-found: error

publish:
name: Publish to PyPI
needs: [test, corpus-regression]
runs-on: ubuntu-latest
if: github.event_name == 'release'

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install build tools
run: python -m pip install --upgrade pip build twine
- name: Verify release version
run: |
package_version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
test "v${package_version}" = "${GITHUB_REF_NAME}"
- name: Build distributions
run: python -m build
- name: Check distributions
run: twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/* --verbose
Loading