mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-01-19 11:57:46 -05:00
31 lines
514 B
Bash
Executable File
31 lines
514 B
Bash
Executable File
#!/bin/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/1.0.0-SNAPSHOT/$VERSION/g" config.groovy
|
|
git add config.groovy
|
|
git commit -m "Update version of $BRANCH to $VERSION"
|
|
|
|
#push branch
|
|
git push -f origin "$BRANCH:$BRANCH"
|
|
|
|
#push tag
|
|
git tag "$VERSION"
|
|
git push origin "$VERSION"
|
|
|
|
#bach to master branch
|
|
git checkout master
|