github.com/klaytn/klaytn@v1.12.1/release_rc.sh (about) 1 #!/bin/bash 2 3 # Fetch tags from upstream first 4 git fetch -t git@github.com:klaytn/klaytn.git 5 6 VERSION=$(go run build/rpm/main.go version) 7 echo "Trying to tag $VERSION" 8 git tag | grep "$VERSION\$" 9 if [ $? -eq 0 ]; then 10 echo "$VERSION is found in git tag!!! You should upgrade version number first!!!" 11 echo "Exiting..." 12 exit 1 13 fi 14 15 PREV_RCVERSION_FULL=`git tag | grep "$VERSION" | sort | tail -1` 16 RCSUFFIX="1" 17 if [ ! -z "$PREV_RCVERSION_FULL" ]; then 18 RCSUFFIX=$(echo "${PREV_RCVERSION_FULL##*.}"+1 | bc) 19 fi 20 21 RCVERSION="$VERSION-rc.$RCSUFFIX" 22 echo "tagging $RCVERSION" 23 24 git tag $RCVERSION 25 git push upstream $RCVERSION