Skip to content

Commit

Permalink
[chore] add Makefile to automation release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Jun 21, 2024
1 parent 8871233 commit 4d07ca3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
release-patch:
latest_tag=$(git tag -l --sort=-creatordate | head -n 1)
# Extract the version parts

major=$(echo "$latest_tag" | cut -d'.' -f1)
minor=$(echo "$latest_tag" | cut -d'.' -f2)
patch=$(echo "$latest_tag" | cut -d'.' -f3)

# Increment the patch version
new_patch=$((patch + 1))

# Combine the new version
new_version="${major}.${minor}.${new_patch}"

# Release with tags
git tag -am "[release] release version ${new_version}" ${new_version}
git push --tags

echo "The version ${new_version} has been released successfully"

.PHONY: release-patch

0 comments on commit 4d07ca3

Please sign in to comment.