Created
November 24, 2020 12:29
-
-
Save wojtek-oledzki/efb737a0a36d7eef6c79da3563f4d24f to your computer and use it in GitHub Desktop.
bumpup
This file contains hidden or 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
VERSION ?= $(shell git describe --tags --match "$(VERSION_BASE)*" || echo $(VERSION_BASE).0) | |
VERSION_BASE ?= $(shell cat "$(PWD)/.version") | |
## Create new version tag based on the nearest tag | |
version.bumpup: | |
@git fetch --tags | |
@git tag $$((git describe --abbrev=0 --tags --match "$(VERSION_BASE)*" || echo $(VERSION_BASE).-1) | perl -pe 's/^(v(\d+\.)*)(-?\d+)(.*)$$/$$1.($$3+1).$$4/e') | |
$(MAKE) version.pprint | |
@echo "Remember to push new tag to remote server." | |
## Push current version tag | |
version.push: | |
git push --no-verify origin tag $(VERSION) | |
## Prints current version | |
version.print: | |
@echo "$(VERSION)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment