Repository navigation
v0.3.0 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| pypi: | |
| # The repo also hosts the web/ site. Only `v*` tags release the Python | |
| # package; any other tag namespace is ignored rather than failing the | |
| # version check below. | |
| if: startsWith(github.ref_name, 'v') | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check tag matches package version | |
| run: | | |
| tag="${GITHUB_REF_NAME#v}" | |
| version=$(grep -Po '^version = "\K[^"]+' pyproject.toml) | |
| if [[ $tag != "$version" ]]; then | |
| echo "Release tag $GITHUB_REF_NAME does not match pyproject.toml version $version" >&2 | |
| exit 1 | |
| fi | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| with: | |
| enable-cache: false | |
| - name: Build distributions | |
| run: uv build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |