Skip to content

https://arxiv.org/abs/2606.28344. The end of web parsing. The beginning of scalable pixel-native search. link: https://pixelrag.ai/

chore(release): fail a release whose tag disagrees with pyproject version (#148)

Zhifei Li6fae6cefff38
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 942afb6..b72d2ab 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -32,6 +32,20 @@ jobs:
with:
version: "latest"
+ # Guard against tag/version drift: a release tag `vX.Y.Z` must match the
+ # version in pyproject.toml, otherwise we'd build (and try to overwrite) the
+ # wrong version on PyPI. Only enforced for the `release` trigger (which has a tag).
+ - name: Check tag matches package version
+ if: ${{ github.event_name == 'release' }}
+ run: |
+ tag="${GITHUB_REF_NAME#v}"
+ pkg="$(uv version --short)"
+ if [ "$tag" != "$pkg" ]; then
+ echo "::error::Release tag ($tag) does not match pyproject.toml version ($pkg). Bump the version and re-tag."
+ exit 1
+ fi
+ echo "Tag and package version agree: $pkg"
+
- name: Build
run: uv build --out-dir dist