|  | @@ -1,10 +1,11 @@
 | 
											
												
													
														|  |  #!/bin/bash
 |  |  #!/bin/bash
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  VER=$1
 |  |  VER=$1
 | 
											
												
													
														|  | -MSG=$2
 |  | 
 | 
											
												
													
														|  | 
 |  | +PRE=$2
 | 
											
												
													
														|  | 
 |  | +PROJECT=$3
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -if [ -z "$MSG" ]; then
 |  | 
 | 
											
												
													
														|  | -  MSG="Weekly Release"
 |  | 
 | 
											
												
													
														|  | 
 |  | +if [ -z "$PRE" ]; then
 | 
											
												
													
														|  | 
 |  | +  PRE="true"
 | 
											
												
													
														|  |  fi
 |  |  fi
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  echo Creating a new release: $VER: $MSG
 |  |  echo Creating a new release: $VER: $MSG
 | 
											
										
											
												
													
														|  | @@ -17,10 +18,19 @@ VERN=${MAJOR}.${MINOR}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  pushd $GOPATH/src/v2ray.com/core
 |  |  pushd $GOPATH/src/v2ray.com/core
 | 
											
												
													
														|  |  echo "Adding a new tag: " "v$VER"
 |  |  echo "Adding a new tag: " "v$VER"
 | 
											
												
													
														|  | -git tag -s -a "v$VER" -m "$MSG"
 |  | 
 | 
											
												
													
														|  | 
 |  | +git tag -s -a "v$VER" -m "Version ${VER}"
 | 
											
												
													
														|  |  sed -i '' "s/\(version *= *\"\).*\(\"\)/\1$VERN\2/g" core.go
 |  |  sed -i '' "s/\(version *= *\"\).*\(\"\)/\1$VERN\2/g" core.go
 | 
											
												
													
														|  |  echo "Commiting core.go (may not necessary)"
 |  |  echo "Commiting core.go (may not necessary)"
 | 
											
												
													
														|  |  git commit core.go -S -m "Update version"
 |  |  git commit core.go -S -m "Update version"
 | 
											
												
													
														|  |  echo "Pushing changes"
 |  |  echo "Pushing changes"
 | 
											
												
													
														|  |  git push --follow-tags
 |  |  git push --follow-tags
 | 
											
												
													
														|  | -popd
 |  | 
 | 
											
												
													
														|  | 
 |  | +popd
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +echo "Launching build machine."
 | 
											
												
													
														|  | 
 |  | +DIR="$(dirname "$0")"
 | 
											
												
													
														|  | 
 |  | +gcloud compute instances create "build-upload" \
 | 
											
												
													
														|  | 
 |  | +    --machine-type=n1-highcpu-2 \
 | 
											
												
													
														|  | 
 |  | +    --metadata=release_tag=v${VER},prerelease=${PRE} \
 | 
											
												
													
														|  | 
 |  | +    --metadata-from-file=startup-script=${DIR}/release-ci.sh \
 | 
											
												
													
														|  | 
 |  | +    --zone=us-west1-a \
 | 
											
												
													
														|  | 
 |  | +    --project ${PROJECT}
 |