Skip to content

Commit

Permalink
Release version should follow semantic versioning format (#258)
Browse files Browse the repository at this point in the history
* update

* Update release.sh

* fix exit type
  • Loading branch information
parano committed Aug 7, 2019
1 parent 540a38d commit d652794
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/release.sh
Expand Up @@ -5,7 +5,16 @@ if [ "$#" -eq 1 ]; then
VERSION_STR=$1 VERSION_STR=$1
else else
echo "Must provide release version string, e.g. ./script/release.sh 1.0.5" echo "Must provide release version string, e.g. ./script/release.sh 1.0.5"
exit 0 exit 1
fi

SEMVER_REGEX="^[vV]?(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$"

if [[ "$VERSION_STR" =~ $SEMVER_REGEX ]]; then
echo "Releasing bentoml version v$VERSION_STR:"
else
echo "Version $VERSION_STR must follow semantic versioning schema"
exit 1
fi fi


GIT_ROOT=$(git rev-parse --show-toplevel) GIT_ROOT=$(git rev-parse --show-toplevel)
Expand All @@ -17,7 +26,7 @@ if [ ! -f $HOME/.pypirc ]; then
# about .pypirc file: # about .pypirc file:
# https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file # https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file
echo "Error: File \$HOME/.pypirc not found." echo "Error: File \$HOME/.pypirc not found."
exit exit 1
fi fi




Expand Down

0 comments on commit d652794

Please sign in to comment.