From 4d07ca318fe52226d8db6ba9df77e04e463f499a Mon Sep 17 00:00:00 2001 From: "Cuong. Duong Manh" Date: Fri, 21 Jun 2024 09:11:06 +0700 Subject: [PATCH] [chore] add Makefile to automation release commit --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1341a91 --- /dev/null +++ b/Makefile @@ -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