Created
February 8, 2017 15:01
-
-
Save cojack/8347bd679f82997ebce65ab44e7b1fe4 to your computer and use it in GitHub Desktop.
Automatically bump version in package.json and commit it, merge to master, then create tag and push evrything to origin
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
bump_version () { | |
git fetch origin | |
git checkout develop | |
git pull origin develop | |
npm version patch --no-git-tag-version | |
VERSION=$(grep -m1 version package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g') | |
git commit package.json -m "chore(package): Bump version up to $VERSION" | |
git push origin develop | |
git checkout master | |
git pull origin master | |
git merge --no-ff --no-edit develop | |
git tag "$VERSION" | |
git push | |
git push --tags | |
} | |
alias git-bump="bump_version" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment