Skip to content

v1.0.3-rc1

v1.0.3-rc1 #23

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
publish-to-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Set version from release tag
if: github.event_name == 'release'
run: |
# Strip leading 'v' and normalize to PEP 440 (e.g. 1.0.0-rc1 -> 1.0.0rc1)
VERSION="${{ github.event.release.tag_name }}"
VERSION="${VERSION#v}"
VERSION="$(echo "$VERSION" | sed 's/-\(a\|alpha\|b\|beta\|rc\)/\1/')"
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
- run: uv build
- run: uv publish