Update release.sh to allow releasing to TestPyPI without re-tag
@@ -36,7 +36,15 @@ if [ -d $GIT_ROOT/dist ]; then
fi
tag_name="v$VERSION_STR"
+
+if git rev-parse $tag_name >/dev/null 2>&1; then
+ echo "git tag '$tag_name' exist, using existing tag."
+ git checkout $tag_name
+else
+ echo "Creatin git tag '$tag_name'"
git tag -a $tag_name -m "Tag generated by BentoML/script/release.sh, version: $VERSION_STR"
+ git push origin $tag_name
+fi
echo "Installing dev dependencies..."
pip install .[dev]
@@ -50,5 +58,3 @@ REPO=${REPO:=testpypi}
echo "Uploading package to $REPO..."
twine upload --repository $REPO dist/* --verbose
-
-git push origin $tag_name
