Skip to content

Commit

Permalink
Update travis to go 1.10.x, enable soft/hard-float for mips build (#80)…
Browse files Browse the repository at this point in the history
… (#86)
  • Loading branch information
jemyzhang authored and shawn1m committed May 9, 2018
1 parent 05f1ac4 commit 5dba2ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.9.x
- 1.10.x
addons:
apt:
packages:
Expand All @@ -22,7 +22,8 @@ deploy:
- overture-linux-amd64.zip
- overture-linux-arm.zip
- overture-linux-arm64.zip
- overture-linux-mips.zip
- overture-linux-mips-softfloat.zip
- overture-linux-mips-hardfloat.zip
- overture-linux-mipsle.zip
- overture-linux-mips64.zip
- overture-linux-mips64le.zip
Expand Down
12 changes: 7 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
["linux", "amd64"],
["linux", "arm"],
["linux", "arm64"],
["linux", "mips"],
["linux", "mips", "softfloat"],
["linux", "mips", "hardfloat"],
["linux", "mipsle"],
["linux", "mips64"],
["linux", "mips64le"],
Expand All @@ -34,17 +35,18 @@ def download_file():

def go_build_zip():
subprocess.check_call("go get -v github.com/shawn1m/overture/main", shell=True)
for o, a in GO_OS_ARCH_LIST:
zip_name = "overture-" + o + "-" + a
for o, a, *p in GO_OS_ARCH_LIST:
zip_name = "overture-" + o + "-" + a + ("-" + (p[0] if p else "") if p else "")
binary_name = zip_name + (".exe" if o == "windows" else "")
version = subprocess.check_output("git describe --tags", shell=True).decode()
mipsflag = (" GOMIPS=" + (p[0] if p else "") if p else "")
try:
subprocess.check_call("GOOS=" + o + " GOARCH=" + a + " CGO_ENABLED=0" + " go build -ldflags \"-s -w " +
subprocess.check_call("GOOS=" + o + " GOARCH=" + a + mipsflag + " CGO_ENABLED=0" + " go build -ldflags \"-s -w " +
"-X main.version=" + version + "\" -o " + binary_name + " main/main.go", shell=True)
subprocess.check_call("zip " + zip_name + ".zip " + binary_name + " " + IP_NETWORK_SAMPLE_DICT["name"] + " " +
DOMAIN_SAMPLE_DICT["name"] + " hosts_sample config.json", shell=True)
except subprocess.CalledProcessError:
print(o + " " + a + " failed.")
print(o + " " + a + " " + (p[0] if p else "") + " failed.")


def decode_domain_sample():
Expand Down

0 comments on commit 5dba2ec

Please sign in to comment.