Created
November 5, 2020 22:00
-
-
Save ibiqlik/1a648d87cf9d29d382e9b7a3de37cde8 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