Skip to content

Commit cd6c851

Browse files
committed
chore: Add version validation
1 parent f8ff04d commit cd6c851

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ permissions:
1010
id-token: write
1111

1212
jobs:
13+
validate-version:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
20+
with:
21+
version: "latest"
22+
enable-cache: true
23+
24+
- name: Validate version matches tag
25+
run: |
26+
TAG_VERSION=${{ github.ref_name }}
27+
PYPROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
28+
if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
29+
echo "Error: Git tag ($TAG_VERSION) doesn't match pyproject.toml version ($PYPROJECT_VERSION)"
30+
exit 1
31+
fi
32+
1333
lint:
1434
runs-on: ubuntu-latest
1535
steps:
@@ -52,7 +72,7 @@ jobs:
5272
run: uv run pytest
5373

5474
build-and-publish:
55-
needs: [lint, test]
75+
needs: [validate-version, lint, test]
5676
runs-on: ubuntu-latest
5777

5878
steps:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "django-generic-notifications"
3-
version = "1.1.1"
3+
version = "1.2.0"
44
description = "A flexible, multi-channel notification system for Django applications with built-in support for email digests, user preferences, and extensible delivery channels."
55
authors = [
66
{name = "Kevin Renskers", email = "[email protected]"},

0 commit comments

Comments
 (0)