mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-02-01 02:03:18 -05:00
32 lines
585 B
Bash
Executable File
32 lines
585 B
Bash
Executable File
#!/bin/bash
|
|
|
|
BRANCH="$1"
|
|
VERSION="$2"
|
|
|
|
if [[ "$BRANCH" == 'beta' && -n "$VERSION" ]]; then
|
|
git checkout master
|
|
|
|
elif [[ "$BRANCH" == 'production' && -n "$VERSION" ]]; then
|
|
git checkout beta
|
|
|
|
else
|
|
echo "Usage: release.sh <branch> <version>"
|
|
exit 0
|
|
fi
|
|
|
|
git branch -D "$BRANCH"
|
|
git checkout -b "$BRANCH"
|
|
sed -i "s/1.0.0-SNAPSHOT/$VERSION/g" config.groovy
|
|
|
|
|
|
git add config.groovy
|
|
git commit -m "Update version of $BRANCH to $VERSION"
|
|
git push -f origin "$BRANCH:$BRANCH"
|
|
|
|
if [[ "$BRANCH" == 'production' ]]; then
|
|
git tag "$VERSION"
|
|
git push origin "$VERSION"
|
|
fi
|
|
|
|
git checkout master
|