Skip to content

Commit b7c8d72

Browse files
committed
chore: release v3.1.0
The manifest has been at 3.x since the two feat! commits (#1, #2), but releases kept being cut as v1.0.x. Since the workflow publishes the manifest version rather than the tag, the release labelled v1.0.5 in fact published 3.0.0 to PyPI, and the next v1.0.x release then failed. Bump to 3.1.0 for the additive changes since 3.0.0 (#3, #4, #5) and fail the publish job up front when the release tag, pyproject.toml version and __version__ disagree.
1 parent 71e0b56 commit b7c8d72

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ jobs:
2929
- uses: actions/setup-python@v5
3030
with:
3131
python-version: "3.12"
32+
- name: Verify release tag matches pyproject.toml version
33+
run: |
34+
tag="${GITHUB_REF_NAME#v}"
35+
proj="$(python -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
36+
dunder="$(grep -oP '(?<=^__version__ = ")[^"]+' src/pkmnprices/__init__.py)"
37+
if [ "$tag" != "$proj" ] || [ "$proj" != "$dunder" ]; then
38+
echo "::error::Version mismatch — tag $GITHUB_REF_NAME, pyproject.toml $proj, __version__ $dunder."
39+
echo "PyPI publishes the manifest version, not the tag. Bump pyproject.toml or retag as v$proj."
40+
exit 1
41+
fi
3242
- run: pip install build
3343
- run: python -m build
3444
- uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "pkmnprices"
7-
version = "3.0.0"
7+
version = "3.1.0"
88
description = "Python client for the Pkmn Prices API"
99
readme = "README.md"
1010
license = "MIT"

src/pkmnprices/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
TcgplayerListing,
3232
)
3333

34-
__version__ = "3.0.0"
34+
__version__ = "3.1.0"
3535

3636
__all__ = [
3737
"PkmnPrices",

0 commit comments

Comments
 (0)