diff --git a/bin/release.sh b/bin/release.sh index a6fccea24..1c7cf2d09 100755 --- a/bin/release.sh +++ b/bin/release.sh @@ -8,6 +8,7 @@ then exit 1 fi +NOW=$(date +%s) CURRENT_BRANCH="master" VERSION=$1 BASEPATH=$(cd `dirname $0`; cd ../src/; pwd) @@ -24,7 +25,7 @@ for REMOTE in $repos do echo "" echo "" - echo "Releasing $REMOTE"; + echo "Cloning $REMOTE"; TMP_DIR="/tmp/hyperf-split" REMOTE_URL="git@github.com:hyperf-cloud/$REMOTE.git" @@ -37,7 +38,14 @@ do git clone $REMOTE_URL . git checkout "$CURRENT_BRANCH"; - git tag $VERSION - git push origin --tags + if [[ $(git log --pretty="%d" -n 1 | grep tag --count) -eq 0 ]]; then + echo "Releasing $REMOTE" + git tag $VERSION + git push origin --tags + fi ) -done \ No newline at end of file +done + +TIME=$(echo "$(date +%s) - $NOW" | bc) + +printf "Execution time: %f seconds" $TIME \ No newline at end of file