Skip to content

Commit 409ea9c

Browse files
committed
fix release
1 parent 41e5e31 commit 409ea9c

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

scripts/bump.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ case "$1" in
1414
*) echo "Usage: $0 {major|minor|patch}"; exit 1 ;;
1515
esac
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"
1926
git tag "$new_tag"
2027
git push origin HEAD "$new_tag"
2128
echo "Bumped to $new_tag"

scripts/release.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@ fi
1616

1717
# Get the latest tag
1818
LATEST_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
3431
echo "Creating GitHub release..."

0 commit comments

Comments
 (0)