We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d084fc commit 1f0f99dCopy full SHA for 1f0f99d
1 file changed
.github/workflows/release.yml
@@ -5,8 +5,27 @@ on:
5
types: [published]
6
7
jobs:
8
+ check-version:
9
+ name: Verify version matches tag
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout repository
13
+ uses: actions/checkout@v6
14
+
15
+ - name: Extract and compare versions
16
+ run: |
17
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
18
+ TOML_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
19
20
+ if [ "$TAG_VERSION" != "$TOML_VERSION" ]; then
21
+ echo "Version mismatch: tag is v$TAG_VERSION, pyproject.toml is $TOML_VERSION"
22
+ exit 1
23
+ fi
24
+ echo "Versions match: $TOML_VERSION"
25
26
pypi-publish:
27
name: Publish to PyPI
28
+ needs: check-version
29
environment: release
30
runs-on: ubuntu-latest
31
permissions:
0 commit comments