Skip to content

Commit

Permalink
add release for freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Jul 27, 2016
1 parent b7ff8b8 commit 330abd1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 13 additions & 1 deletion tools/build/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const (
Windows = GoOS("windows")
MacOS = GoOS("darwin")
Linux = GoOS("linux")
FreeBSD = GoOS("freebsd")
UnknownOS = GoOS("unknown")
)

Expand All @@ -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
}

Expand Down Expand Up @@ -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
}

0 comments on commit 330abd1

Please sign in to comment.