diff --git a/.travis.yml b/.travis.yml index 1da28b9..b3b89f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,19 @@ language: go -sudo: false +dist: bionic +sudo: required go: - - tip # Latest go version + - 1.16.x # Latest go version +env: + - azure-linux + - GO111MODULE=on +addons: + apt: + packages: + - gcc-multilib before_install: # gox simplifies building for multiple architectures - - go get github.com/mitchellh/gox + - go get github.com/necrose99/gox install: - # skip @@ -14,7 +22,8 @@ script: - go get -t -v ./... - diff -u <(echo -n) <(gofmt -d .) - go vet $(go list ./... | grep -v /vendor/) - - gox -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./... + - sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross + - GOX_linux_arm_LDFLAGS="-linkmode external -extldflags -static" GOX_linux_arm_CC=arm-linux-gnueabi-gcc GOX_linux_arm64_LDFLAGS="-linkmode external -extldflags -static" GOX_linux_arm64_CC=aarch64-linux-gnu-gcc gox -rebuild -parallel=1 -verbose -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./... deploy: provider: releases diff --git a/Makefile b/Makefile index 7ebbaf3..aca8bab 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,10 @@ build: dep mkdir -p $(BUILDDIR) cp scripts/wg-portal.service $(BUILDDIR) cp scripts/wg-portal.env $(BUILDDIR) - gox -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./... + GOX_linux_arm_LDFLAGS="-linkmode external -extldflags -static" GOX_linux_arm_CC=arm-linux-gnueabihf-gcc GOX_linux_arm64_LDFLAGS="-linkmode external -extldflags -static" GOX_linux_arm64_CC=aarch64-linux-gnu-gcc gox -rebuild -parallel=1 -verbose -cgo -os="linux" -arch="amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=`git rev-parse --short HEAD`" -verbose ./... dep: - $(GOCMD) get github.com/mitchellh/gox + $(GOCMD) get github.com/necrose99/gox $(GOCMD) mod download validate: dep diff --git a/go.mod b/go.mod index d7c1adf..9e3e5fc 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/milosgajdos/tenus v0.0.3 github.com/mitchellh/gox v1.0.1 // indirect + github.com/necrose99/gox v0.4.0 // indirect github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.7.0 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e