Skip to content

Commit

Permalink
bump-version.sh: Always run on master
Browse files Browse the repository at this point in the history
  • Loading branch information
korya committed Oct 24, 2023
1 parent 489b8ca commit fce309b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions script/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
exit 1
fi

if [[ "$(git branch --show-current)" != 'master' ]]; then
echo 'Error: Not on master branch'
echo ''
echo 'Switch to the master branch before running this script'
exit 1
fi

case "$1" in
major)
jqExpr='.version |= ((split(".") | .[0] | tonumber + 1 | tostring) + ".0.0")'
Expand All @@ -46,19 +53,19 @@ mv package.json.tmp package.json

npm i


gitTag="v$(jq -r .version package.json)"

echo ''
echo 'Done'
echo ''
echo '1. Review and commit the changes:'
echo '1. Review the changes:'
git status -s
git diff package.json
echo ''
echo '2. Tag the release:'
echo '2. Commit the changes and tag the release:'
echo " git commit -m 'Bump version to ${gitTag}' package.json package-lock.json"
echo " git tag -a ${gitTag} -m '${gitTag}'"
echo ''
echo '3. Publish the release:'
echo " git push origin ${gitTag}"
echo " git push --follow-tags origin master"
echo ' npm publish'

0 comments on commit fce309b

Please sign in to comment.