mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-01-23 13:57:44 -05:00
28 lines
468 B
Bash
Executable File
28 lines
468 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
VERSION="$1"
|
|
BRANCH="production"
|
|
|
|
# sanity
|
|
if [[ -z "$VERSION" ]]; then
|
|
echo "Usage: release.sh <version>"
|
|
exit 0
|
|
fi
|
|
|
|
# prepare branch
|
|
git checkout master
|
|
git branch -D "$BRANCH"
|
|
git checkout -b "$BRANCH"
|
|
|
|
# update version
|
|
sed -i "s/master/$VERSION/g" config.groovy
|
|
git add config.groovy
|
|
git commit -m "Update version of $BRANCH to $VERSION"
|
|
|
|
# push tag
|
|
git tag "$VERSION"
|
|
git push origin "$VERSION"
|
|
|
|
# back to master branch
|
|
git checkout master
|