Skip to content

Commit 22ba74a

Browse files
committed
release: derive version from git tag, not pyproject.toml
Replaces the verify-tag-matches-pyproject step with `uv version ${tag}` so the git tag is the single source of truth. Allows tagging vX.Y.Z without bumping pyproject.toml first.
1 parent 4948d2b commit 22ba74a

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ jobs:
1515
- uses: astral-sh/setup-uv@v3
1616
with:
1717
enable-cache: true
18-
- name: Verify tag matches pyproject.toml version
19-
run: |
20-
tag="${GITHUB_REF_NAME#v}"
21-
pkg=$(grep -m1 -E '^version\s*=' pyproject.toml | sed -E 's/version\s*=\s*"([^"]+)"/\1/')
22-
if [ "$tag" != "$pkg" ]; then
23-
echo "::error::Tag v$tag does not match pyproject.toml version $pkg"
24-
exit 1
25-
fi
18+
- name: Set version from tag
19+
run: uv version "${GITHUB_REF_NAME#v}"
2620
- run: uv build
2721
- run: uvx --from twine twine check dist/*
2822
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)