From 330abd126c37d020fedddd354bba93f0e5c3feda Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 27 Jul 2016 16:56:32 +0200 Subject: [PATCH] add release for freebsd --- .travis.yml | 2 ++ release/release.sh | 2 ++ tools/build/env.go | 14 +++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bd0ba952..a7600bb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,8 @@ deploy: - "$GOPATH/bin/v2ray-linux-arm.zip" - "$GOPATH/bin/v2ray-linux-arm64.zip" - "$GOPATH/bin/v2ray-linux-mips64.zip" + - "$GOPATH/bin/v2ray-freebsd-64.zip" + - "$GOPATH/bin/v2ray-freebsd-32.zip" - "$GOPATH/bin/metadata.txt" skip_cleanup: true on: diff --git a/release/release.sh b/release/release.sh index 76d9e57e..07041879 100755 --- a/release/release.sh +++ b/release/release.sh @@ -10,3 +10,5 @@ $GOPATH/bin/build --os=linux --arch=x64 --zip $GOPATH/bin/build --os=linux --arch=arm --zip $GOPATH/bin/build --os=linux --arch=arm64 --zip $GOPATH/bin/build --os=linux --arch=mips64 --zip +$GOPATH/bin/build --os=freebsd --arch=x86 --zip +$GOPATH/bin/build --os=freebsd --arch=amd64 --zip \ No newline at end of file diff --git a/tools/build/env.go b/tools/build/env.go index 2ee4b984..ac148a00 100644 --- a/tools/build/env.go +++ b/tools/build/env.go @@ -10,6 +10,7 @@ const ( Windows = GoOS("windows") MacOS = GoOS("darwin") Linux = GoOS("linux") + FreeBSD = GoOS("freebsd") UnknownOS = GoOS("unknown") ) @@ -35,6 +36,9 @@ func parseOS(rawOS string) GoOS { if osStr == "linux" || osStr == "debian" || osStr == "ubuntu" || osStr == "redhat" || osStr == "centos" { return Linux } + if osStr == "freebsd" { + return FreeBSD + } return UnknownOS } @@ -83,7 +87,15 @@ func getSuffix(os GoOS, arch GoArch) string { case Mips64: suffix = "-linux-mips64" } - + case FreeBSD: + switch arch { + case X86: + suffix = "-freebsd-32" + case Amd64: + suffix = "-freebsd-64" + case Arm: + suffix = "-freebsd-arm" + } } return suffix }