-
-
Save fpersson/c880c1ecdd09a01d7dab0a08a1f6b1cd to your computer and use it in GitHub Desktop.
Makefile bump git tag and push
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
RELEASE_TYPE ?= patch | |
LATEST_TAG ?= $(shell git ls-remote -q --tags --sort=-v:refname | head -n1 | awk '{ print $2 }' | sed 's/refs\/tags\///g') | |
LATEST_SHA ?= $(shell git rev-parse origin/main) | |
NEW_TAG ?= $(shell docker run -it --rm alpine/semver semver -c -i $(RELEASE_TYPE) $(LATEST_TAG)) | |
release: | |
git tag "v$(NEW_TAG)" $(LATEST_SHA) | |
git push origin "v$(NEW_TAG)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment