浏览代码

add release for freebsd

v2ray 9 年之前
父节点
当前提交
330abd126c
共有 3 个文件被更改,包括 17 次插入1 次删除
  1. 2 0
      .travis.yml
  2. 2 0
      release/release.sh
  3. 13 1
      tools/build/env.go

+ 2 - 0
.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:

+ 2 - 0
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

+ 13 - 1
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
 }