wg-portal/.travis.yml

43 lines
1.5 KiB
YAML

language: go
dist: bionic
sudo: required
go:
- 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/necrose99/gox
install:
- # skip
script:
- go get -t -v ./...
- diff -u <(echo -n) <(gofmt -d .)
- go vet $(go list ./... | grep -v /vendor/)
- 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
skip_cleanup: true # Important, otherwise the build output would be purged.
api_key:
# *encrypted* GitHub key, as the output of the Travis CI CLI tool
secure: TODO...
file:
- dist/wg-portal_linux_amd64
- dist/wg-portal_linux_arm64
- dist/wg-portal_linux_arm
- dist/wg-portal.env
- dist/wg-portal.service
on:
repo: h44z/wg-portal
tags: true # The deployment happens only if the commit has a tag.