Skip to content

Commit 23c649d

Browse files
authored
Update publish.yml
1 parent 6fcb7fb commit 23c649d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ jobs:
3737
- name: Verify package version
3838
run: |
3939
PACKAGE_VERSION=$(python -c "import toml; print(toml.load(open('pyproject.toml'))['project']['version'])")
40+
TAG_VERSION="${{ github.ref_name }}"
41+
42+
# Remove 'v' prefix if it exists from the tag name
43+
RELEASE_VERSION=${TAG_VERSION#v}
44+
4045
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."
46+
echo "Expected release version from tag: $RELEASE_VERSION (from tag $TAG_VERSION)"
47+
48+
if [ "$PACKAGE_VERSION" != "$RELEASE_VERSION" ]; then
49+
echo "Error: The version in pyproject.toml ($PACKAGE_VERSION) does not match the release tag version ($RELEASE_VERSION)."
4450
exit 1
4551
fi
4652

0 commit comments

Comments
 (0)