Created
October 9, 2015 20:08
-
-
Save SpainTrain/d4122936beec0da4639c to your computer and use it in GitHub Desktop.
bash script to check for release directive and bump, tag, and publish to npm
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
#!/bin/bash | |
set -ex | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI" | |
git config --global push.default simple | |
LAST_COMMIT_MSG="$(git log -1 --pretty=%B)" | |
SEMVER_BUMP_TYPE="$(echo ${LAST_COMMIT_MSG} | sed -n 's/^.*[rR]elease v+\([a-z]\+\).*$/\1/p')" | |
if [ -n "${SEMVER_BUMP_TYPE}" ]; then | |
npm version ${SEMVER_BUMP_TYPE} -m ":arrow_up: CircleCI: Releasing %s" | |
git push | |
git push --tags | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment