Skip to content

Commit fea9ecb

Browse files
committed
Update Makefile
1 parent c893108 commit fea9ecb

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: Makefile

+13-6
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,22 @@ benchmark_proof_sizes: ## runs the benchmarks test the proof sizes for differen
100100
# Delete tag remotely: git push --delete origin v1.2.3
101101

102102
.PHONY: tag_bug_fix
103-
tag_bug_fix: ## Tag a new bug fix release (e.g. v1.0.1 -> v1.0.2)
104-
@$(eval LATEST_TAG=$(shell git describe --tags `git rev-list --tags --max-count=1`))
105-
@$(eval NEW_TAG=$(shell echo $(LATEST_TAG) | awk -F. '{$$3 += 1; print $$1 "." $$2 "." $$3}'))
103+
tag_bug_fix: ## Tag a new bug fix release (e.g., v1.0.1 -> v1.0.2)
104+
@$(eval LATEST_TAG=$(shell git tag --sort=-v:refname | head -n 1))
105+
@$(eval NEW_TAG=$(shell echo $(LATEST_TAG) | awk -F. -v OFS=. '{ $$NF = sprintf("%d", $$NF + 1); print }'))
106106
@git tag $(NEW_TAG)
107-
@echo "New bug fix version: $(NEW_TAG)\nRun:\tgit push origin $(NEW_TAG)\nAnd draft a new release at https://github.com/pokt-network/smt/releases/new"
107+
@echo "New bug fix version tagged: $(NEW_TAG)"
108+
@echo "Run the following commands to push the new tag:"
109+
@echo " git push origin $(NEW_TAG)"
110+
@echo "And draft a new release at https://github.com/pokt-network/smt/releases/new"
111+
108112

109113
.PHONY: tag_minor_release
110114
tag_minor_release: ## Tag a new minor release (e.g. v1.0.0 -> v1.1.0)
111-
@$(eval LATEST_TAG=$(shell git describe --tags `git rev-list --tags --max-count=1`))
115+
@$(eval LATEST_TAG=$(shell git tag --sort=-v:refname | head -n 1))
112116
@$(eval NEW_TAG=$(shell echo $(LATEST_TAG) | awk -F. '{$$2 += 1; $$3 = 0; print $$1 "." $$2 "." $$3}'))
113117
@git tag $(NEW_TAG)
114-
@echo "New minor release version: $(NEW_TAG)\nRun:\tgit push origin $(NEW_TAG)\nAnd draft a new release at https://github.com/pokt-network/smt/releases/new"
118+
@echo "New minor release version tagged: $(NEW_TAG)"
119+
@echo "Run the following commands to push the new tag:"
120+
@echo " git push origin $(NEW_TAG)"
121+
@echo "And draft a new release at https://github.com/pokt-network/smt/releases/new"

0 commit comments

Comments
 (0)