| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | #!/bin/bashVER=$1PROJECT=$2DOTCNT=$(echo $VER | grep -o "\." | wc -l)if [ "$DOTCNT" -gt 1 ]; then  PRE="true"else  PRE="false"fiif [ -z "$PROJECT" ]; then  echo "Project not specified. Exiting..."  exit 0fiecho Creating a new release: $VERIFS="." read -a PARTS <<< "$VER"MAJOR=${PARTS[0]}MINOR=${PARTS[1]}MINOR=$((MINOR+1))VERN=${MAJOR}.${MINOR}pushd $GOPATH/src/v2ray.com/coreecho "Adding a new tag: " "v$VER"git tag -s -a "v$VER" -m "Version ${VER}"sed -i '' "s/\(version *= *\"\).*\(\"\)/\1$VERN\2/g" core.goecho "Committing core.go (may not necessary)"git commit core.go -S -m "Update version"echo "Pushing changes"git push --follow-tagspopdpushd $GOPATH/src/v2ray.com/extecho "Adding a new tag: " "v$VER" "to ext"git tag -s -a "v$VER" -m "Version ${VER}"echo "Pushing changes to ext"git push --follow-tagspopdecho "Launching build machine."DIR="$(dirname "$0")"RAND="$(openssl rand -hex 5)"gcloud compute instances create "v2raycore-${RAND}" \    --machine-type=n1-highcpu-2 \    --metadata=release_tag=v${VER},prerelease=${PRE} \    --metadata-from-file=startup-script=${DIR}/release-ci.sh \    --zone=europe-west4-c \    --project ${PROJECT} \    --scopes "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/devstorage.read_write" \
 |