Skip to content

Commit 61ea3a2

Browse files
Make sure tagged version matches setup.py version
1 parent f4b8474 commit 61ea3a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/test-and-release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ jobs:
4848
with:
4949
python-version: "3.x"
5050

51+
- name: Check version
52+
run: |
53+
TAG_VERSION = ${{ github.ref_name }}
54+
PACKAGE_VERSION = $(grep -Po 'version\s*=\s*["\x27]\K[^"\x27]+' setup.py)
55+
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
56+
echo "Version mismatch! GitHub tag is $TAG_VERSION but package version is $PACKAGE_VERSION."
57+
exit 1
58+
fi
59+
5160
- name: Install pypa/build
5261
run: >-
5362
python3 -m

0 commit comments

Comments
 (0)