Skip to content

Instantly share code, notes, and snippets.

@fordnox
Last active November 2, 2020 17:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Makefile semver
git fetch --prune origin "+refs/tags/*:refs/tags/*"
.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