1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-30 19:15:23 +00:00
v2fly/release/release.sh

36 lines
821 B
Bash
Raw Normal View History

2015-09-16 14:30:17 +00:00
#!/bin/bash
2015-09-18 12:35:50 +00:00
VERSION=$(sed -n 's/.*Version.*=.*\"\([^"]*\)\".*/\1/p' $GOPATH/src/github.com/v2ray/v2ray-core/core.go)
2015-09-16 14:30:17 +00:00
REL_PATH=$GOPATH/bin/$VERSION
if [ -d "$REL_PATH" ]; then
rm -rf "$REL_PATH"
fi
mkdir -p $REL_PATH
mkdir -p $REL_PATH/config
cp -R $GOPATH/src/github.com/v2ray/v2ray-core/release/config/* $REL_PATH/config/
function build {
local GOOS=$1
local GOARCH=$2
local EXT=$3
local TARGET=$REL_PATH/v2ray${EXT}
GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${TARGET} -compiler gc github.com/v2ray/v2ray-core/release/server
}
build "darwin" "amd64" "-macos"
build "windows" "amd64" "-windows-64.exe"
build "linux" "amd64" "-linux-64"
build "linux" "386" "-linux-32"
2015-09-18 12:35:50 +00:00
ZIP_FILE=$GOPATH/bin/v2ray.zip
2015-09-16 14:30:17 +00:00
if [ -f $ZIP_FILE ]; then
rm -f $ZIP_FILE
fi
2015-09-18 12:35:50 +00:00
pushd $GOPATH/bin/
zip -r $ZIP_FILE ./$VERSION/*
2015-09-16 14:30:17 +00:00
popd