mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
This script is used to help prep release branches and tags. Since it's not crucial to the business of remote monitoring and only useful as a maintenance tool, we're moving it away from the project root.
34 lines
781 B
Bash
Executable File
34 lines
781 B
Bash
Executable File
#!/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 ""
|
|
|