Skip to content

Commit 7af8131

Browse files
committed
chore: enhance Makefile to automate version bumping and pushing changes
1 parent b9cd785 commit 7af8131

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Makefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ bump-patch:
108108
new_patch=$$((patch + 1)); \
109109
new_version="$$major.$$minor.$$new_patch"; \
110110
echo "Updating version to $$new_version"; \
111-
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$new_version\"/" $(VERSION_FILE)
111+
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$new_version\"/" $(VERSION_FILE); \
112+
git add $(VERSION_FILE); \
113+
git commit -m "Bump version to $$new_version"; \
114+
git tag -a v$$new_version -m "Version $$new_version"; \
115+
echo "Version updated to $$new_version. Don't forget to push with: git push && git push --tags"
112116

113117
# Bump minor version (0.x.0)
114118
bump-minor:
@@ -117,7 +121,11 @@ bump-minor:
117121
new_minor=$$((minor + 1)); \
118122
new_version="$$major.$$new_minor.0"; \
119123
echo "Updating version to $$new_version"; \
120-
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$new_version\"/" $(VERSION_FILE)
124+
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$new_version\"/" $(VERSION_FILE); \
125+
git add $(VERSION_FILE); \
126+
git commit -m "Bump version to $$new_version"; \
127+
git tag -a v$$new_version -m "Version $$new_version"; \
128+
echo "Version updated to $$new_version. Don't forget to push with: git push && git push --tags"
121129

122130
# Bump major version (x.0.0)
123131
bump-major:
@@ -126,7 +134,11 @@ bump-major:
126134
new_major=$$((major + 1)); \
127135
new_version="$$new_major.0.0"; \
128136
echo "Updating version to $$new_version"; \
129-
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$new_version\"/" $(VERSION_FILE)
137+
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$new_version\"/" $(VERSION_FILE); \
138+
git add $(VERSION_FILE); \
139+
git commit -m "Bump version to $$new_version"; \
140+
git tag -a v$$new_version -m "Version $$new_version"; \
141+
echo "Version updated to $$new_version. Don't forget to push with: git push && git push --tags"
130142

131143
# Bump beta version (x.x.x-beta)
132144
bump-beta:
@@ -139,3 +151,7 @@ e2e-test:
139151

140152
e2e-test-mock:
141153
uv run python -m pytest e2e_tests/test_mock.py -v
154+
155+
# Push version changes and tags
156+
push-version:
157+
git push && git push --tags

0 commit comments

Comments
 (0)