From b7969f89b5357d837dcb3999ed71c9c923bbc85d Mon Sep 17 00:00:00 2001 From: Colin Henry Date: Sun, 27 Oct 2024 12:28:57 -0700 Subject: [PATCH] fixed release target --- Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f5bc966..e96987f 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,19 @@ # Variables REPO_REMOTE := origin -VERSION_TAG_PREFIX := "v" # Prefix for version tags, if any # Helper function to get the latest tag and increment the version define next_version - latest_tag=$$(git describe --tags --abbrev=0 2>/dev/null || echo "$(VERSION_TAG_PREFIX)0.0.0"); \ - major=$$(echo $$latest_tag | sed -E 's/$(VERSION_TAG_PREFIX)([0-9]+)\.[0-9]+\.[0-9]+/\1/'); \ - minor=$$(echo $$latest_tag | sed -E 's/$(VERSION_TAG_PREFIX)[0-9]+\.([0-9]+)\.[0-9]+/\1/'); \ - patch=$$(echo $$latest_tag | sed -E 's/$(VERSION_TAG_PREFIX)[0-9]+\.[0-9]+\.([0-9]+)/\1/'); \ + latest_tag=$$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"); \ + major=$$(echo $$latest_tag | sed -E 's/^v([0-9]+)\.[0-9]+\.[0-9]+/\1/'); \ + minor=$$(echo $$latest_tag | sed -E 's/^v[0-9]+\.([0-9]+)\.[0-9]+/\1/'); \ + patch=$$(echo $$latest_tag | sed -E 's/^v[0-9]+\.[0-9]+\.([0-9]+)/\1/'); \ next_patch=$$(($$patch + 1)); \ - echo "$(VERSION_TAG_PREFIX)$$major.$$minor.$$next_patch" + echo "v$$major.$$minor.$$next_patch" endef # Target to tag and push the next version release: @next_version=$$($(next_version)); \ - echo "Tagging with version $$next_version"; \ + echo "Tagging with version $$next_version"; git tag $$next_version; \ - git push $(REPO_REMOTE) $$next_version + git push $(REPO_REMOTE) $$next_version \ No newline at end of file