Skip to content

Commit

Permalink
add script to prep release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bewest committed Sep 13, 2014
1 parent 492ea9d commit aafe285
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions prep_repo_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -ueE

function update ( ) {
upgrade=$1
npm version $upgrade || exit 255
}

RELEASE_NOTES="Release.md"
TYPE=${1-'patch'}
echo "First update"

npm ls . || echo -n ""
NEW_TAG=$(update ${TYPE})
echo "Updating to $NEW_TAG"
# npm commits a new package json on your behalf with a new tag pointed at it
git reset --hard HEAD~1
git tag -d $NEW_TAG || echo "warning ${NEW_TAG} not present"
BRANCH_NAME="release/${NEW_TAG}"
git checkout -b ${BRANCH_NAME}
npm ls . || echo -n ""
cat /dev/null > ${RELEASE_NOTES}
git changelog -t ${NEW_TAG} ${RELEASE_NOTES}
echo "saving release notes"
git add ${RELEASE_NOTES}
git commit -vm "Release notes for ${NEW_TAG}"

echo "Final update"
update ${TYPE}
echo "New version $NEW_TAG"
echo "Branch ${BRANCH_NAME}"
npm ls . || echo -n ""

0 comments on commit aafe285

Please sign in to comment.