Improve version bump script
This commit is contained in:
parent
22317bea37
commit
013daf34af
2 changed files with 38 additions and 16 deletions
27
bump-version.sh
Normal file → Executable file
27
bump-version.sh
Normal file → Executable file
|
|
@ -1,11 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Usage: $0 {patch|minor|major}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $1 =~ ^(patch|minor|major)$ ]]; then
|
||||
echo "Creating a new '$1' version"
|
||||
else
|
||||
echo "Invalid argument: $1"
|
||||
echo "Usage: $0 {patch|minor|major}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
echo "Your working directory is not clean. Please commit or stash your changes before proceeding."
|
||||
exit 1
|
||||
else
|
||||
echo "Your working directory is clean."
|
||||
fi
|
||||
|
||||
cd backend
|
||||
cargo set-version --bump patch
|
||||
cd ../plugin
|
||||
npm version patch
|
||||
cd ..
|
||||
git add .
|
||||
git commit -m "Bump versions"
|
||||
TAG=$(node -p "require('./package.json').version")
|
||||
git commit -m "Bump versions to $TAG"
|
||||
echo "Tagging $TAG"
|
||||
git tag -a $TAG -m "Release $TAG"
|
||||
git push origin $TAG
|
||||
echo "Done"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue