-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] add Makefile to automation release commit
- Loading branch information
1 parent
8871233
commit 4d07ca3
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |