-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
18 lines (18 loc) · 747 Bytes
/
Makefile
File metadata and controls
18 lines (18 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
git_tag_increment_minor_version:
@TAG_ON_HEAD_COMMIT=$$(git tag --points-at HEAD); \
if [ -n "$$TAG_ON_HEAD_COMMIT" ]; \
then \
echo "Tag '$$TAG_ON_HEAD_COMMIT' already exists on that commit. Skipping tagging."; \
else \
echo "Getting last tag..."; \
LAST_TAG=$$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"); \
echo "Last tag: $$LAST_TAG"; \
MAJOR=$$(echo $$LAST_TAG | cut -d. -f1); \
MINOR=$$(echo $$LAST_TAG | cut -d. -f2); \
PATCH=$$(echo $$LAST_TAG | cut -d. -f3); \
NEW_PATCH=$$((PATCH + 1)); NEW_TAG="$${MAJOR}.$${MINOR}.$${NEW_PATCH}"; \
echo "New tag: $$NEW_TAG"; \
git tag "$$NEW_TAG"; \
git push origin "$$NEW_TAG"; \
echo "Tag '$$NEW_TAG' successfully created and pushed."; \
fi