File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed
Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,15 @@ case "$1" in
1414 * ) echo " Usage: $0 {major|minor|patch}" ; exit 1 ;;
1515esac
1616
17- new_tag=" v$major .$minor .$patch "
18- git commit --allow-empty -m " chore: bump version to $new_tag "
17+ new_version=" $major .$minor .$patch "
18+ new_tag=" v$new_version "
19+
20+ # Update version in pyproject.toml
21+ sed -i " s/^version = \" .*\" /version = \" ${new_version} \" /" pyproject.toml
22+
23+ # Commit both version bump and pyproject.toml change
24+ git add pyproject.toml
25+ git commit -m " chore: bump version to $new_tag "
1926git tag " $new_tag "
2027git push origin HEAD " $new_tag "
2128echo " Bumped to $new_tag "
Original file line number Diff line number Diff line change 1616
1717# Get the latest tag
1818LATEST_TAG=$( git describe --tags --abbrev=0)
19- VERSION=${LATEST_TAG# v}
20-
21- # Update version in pyproject.toml
22- sed -i " s/^version = \" .*\" /version = \" ${VERSION} \" /" pyproject.toml
23-
24- # Commit the pyproject.toml change
25- git add pyproject.toml
26- git commit -m " chore: sync pyproject.toml version with tag ${LATEST_TAG} "
27- git push origin main
2819
29- # Wait a few seconds for GitHub to process the push
30- echo " Waiting for GitHub to process the version update..."
31- sleep 5
20+ # Verify versions match
21+ VERSION=${LATEST_TAG# v}
22+ PYPROJECT_VERSION=$( grep ' ^version = ' pyproject.toml | cut -d' "' -f2)
23+ if [ " $VERSION " != " $PYPROJECT_VERSION " ]; then
24+ echo " Error: Version mismatch!"
25+ echo " Git tag: $VERSION "
26+ echo " pyproject.toml: $PYPROJECT_VERSION "
27+ exit 1
28+ fi
3229
3330# Create GitHub release
3431echo " Creating GitHub release..."
You can’t perform that action at this time.
0 commit comments