Last active
November 2, 2020 17:18
-
-
Save fordnox/837ded1d02eff3ff7b378e296e159a4a to your computer and use it in GitHub Desktop.
Makefile semver
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
git fetch --prune origin "+refs/tags/*:refs/tags/*" |
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
.SILENT: | |
revbump: | |
set -e ;\ | |
git tag --sort=v:refname | tail -1 | |
NEW_VERSION=$$( git tag --sort=v:refname | tail -1 | awk 'BEGIN{FS=OFS="."}{print $$1,$$2,$$3+1}' ) ;\ | |
echo "unstable release $$NEW_VERSION" ;\ | |
git tag $$NEW_VERSION | |
git push --tags | |
minorbump: | |
set -e ;\ | |
git tag --sort=v:refname | tail -1 | |
NEW_VERSION=$$( git tag --sort=v:refname | tail -1 | awk 'BEGIN{FS=OFS="."}{print $$1,$$2+1,0}' ) ;\ | |
echo "unstable release $$NEW_VERSION" ;\ | |
git tag $$NEW_VERSION | |
git push --tags | |
majorbump: | |
set -e ;\ | |
git tag --sort=v:refname | tail -1 | |
NEW_VERSION=$$( git tag --sort=v:refname | tail -1 | awk 'BEGIN{FS=OFS="."}{print $$1+1,0,0}' ) ;\ | |
echo "release $$NEW_VERSION" ;\ | |
git tag $$NEW_VERSION | |
git push --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment