File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,14 +34,24 @@ jobs:
3434 python -m pip install --upgrade pip
3535 pip install build twine toml
3636
37- - name : Verify package version
37+ - name: Verify package version
3838 run : |
3939 PACKAGE_VERSION=$(python -c "import toml; print(toml.load(open('pyproject.toml'))['project']['version'])")
40+ RELEASE_TAG_NAME="${{ github.ref_name }}" # e.g., v1.0.12
41+
42+ # --- THE CRUCIAL FIX IS HERE ---
43+ # Strip 'v' prefix from the release tag name for comparison
44+ CLEAN_RELEASE_VERSION=$(echo "$RELEASE_TAG_NAME" | sed 's/^v//')
45+ # --- END OF FIX ---
46+
4047 echo "Detected version from pyproject.toml: $PACKAGE_VERSION"
41- echo "Expected tag version: ${{ github.ref_name }}"
42- if [ "$PACKAGE_VERSION" != "${{ github.ref_name }}" ]; then
43- echo "Error: The version in pyproject.toml does not match the release tag."
48+ echo "Expected cleaned tag version: $CLEAN_RELEASE_VERSION (from tag: $RELEASE_TAG_NAME)"
49+
50+ if [ "$PACKAGE_VERSION" != "$CLEAN_RELEASE_VERSION" ]; then
51+ echo "Error: The version in pyproject.toml ($PACKAGE_VERSION) does not match the cleaned release tag ($CLEAN_RELEASE_VERSION)."
4452 exit 1
53+ else
54+ echo "Version match confirmed: $PACKAGE_VERSION == $CLEAN_RELEASE_VERSION"
4555 fi
4656
4757 - name : Clean old builds and build new package
You can’t perform that action at this time.
0 commit comments