1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-26 09:25:23 +00:00
v2fly/release/make-release.sh

55 lines
1.3 KiB
Bash
Raw Normal View History

2016-07-27 15:50:24 +00:00
#!/bin/bash
VER=$1
2017-04-24 19:12:31 +00:00
PROJECT=$2
2016-07-27 15:50:24 +00:00
2017-04-24 19:12:31 +00:00
DOTCNT=$(echo $VER | grep -o "\." | wc -l)
if [ "$DOTCNT" -gt 1 ]; then
2017-02-23 15:44:59 +00:00
PRE="true"
2017-04-24 19:12:31 +00:00
else
PRE="false"
2018-11-16 20:18:08 +00:00
VER="${VER}.0"
2016-07-27 15:50:24 +00:00
fi
2017-02-23 15:45:55 +00:00
if [ -z "$PROJECT" ]; then
echo "Project not specified. Exiting..."
exit 0
fi
2017-04-24 19:12:31 +00:00
echo Creating a new release: $VER
2016-07-27 15:50:24 +00:00
IFS="." read -a PARTS <<< "$VER"
MAJOR=${PARTS[0]}
MINOR=${PARTS[1]}
MINOR=$((MINOR+1))
VERN=${MAJOR}.${MINOR}
2016-08-20 18:55:45 +00:00
pushd $GOPATH/src/v2ray.com/core
2016-07-27 15:50:24 +00:00
echo "Adding a new tag: " "v$VER"
2017-02-23 15:44:59 +00:00
git tag -s -a "v$VER" -m "Version ${VER}"
2016-07-27 15:50:24 +00:00
sed -i '' "s/\(version *= *\"\).*\(\"\)/\1$VERN\2/g" core.go
2018-03-19 09:01:15 +00:00
echo "Committing core.go (may not necessary)"
2016-08-07 15:13:18 +00:00
git commit core.go -S -m "Update version"
2016-07-27 15:50:24 +00:00
echo "Pushing changes"
git push --follow-tags
2017-02-23 15:44:59 +00:00
popd
2018-04-10 20:23:25 +00:00
pushd $GOPATH/src/v2ray.com/ext
echo "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-tags
popd
2017-02-23 15:44:59 +00:00
echo "Launching build machine."
DIR="$(dirname "$0")"
2017-04-04 21:11:52 +00:00
RAND="$(openssl rand -hex 5)"
gcloud compute instances create "v2raycore-${RAND}" \
2018-11-06 21:02:52 +00:00
--machine-type=n1-standard-2 \
2017-02-23 15:44:59 +00:00
--metadata=release_tag=v${VER},prerelease=${PRE} \
--metadata-from-file=startup-script=${DIR}/release-ci.sh \
2018-08-31 13:14:46 +00:00
--zone=europe-west4-c \
--project ${PROJECT} \
--scopes "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/devstorage.read_write" \