-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.travis.yml
48 lines (41 loc) · 1.19 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
language: go
go:
- 1.x
os:
- osx
- windows
# Run gofmt and tests on linux
matrix:
fast_finish: true
include:
- os: linux
script:
- ./.gofmt.sh
- go test -v ./...
services: docker
allow_failures:
- os: windows
# Modifies LXRHASH bit size, set docker organisation for deployment
env:
- LXRBITSIZE=10 REPO=pegnetd DOCKERORG=pegnet DOCKERUSER=emyrk
script: echo "Not running $travis_script_go on windows and osx"
before_deploy:
# xgo cross compile for github releases
- go get github.com/karalabe/xgo
- xgo -ldflags="-X github.com/pegnet/pegnetd/config.CompiledInBuild=`git rev-parse HEAD` -X github.com/pegnet/pegnetd/config.CompiledInVersion=`git describe --tags`" --targets=windows/amd64,darwin/amd64,linux/amd64 .
# Build and push image to dockerhub
- docker build -t $DOCKERORG/$REPO:$TRAVIS_TAG .
- docker login -u $DOCKERUSER -p $DOCKERHUBTOKEN
- docker push $DOCKERORG/$REPO:$TRAVIS_TAG
deploy:
provider: releases
api_key:
secure: $GITHUBTOKEN
skip_cleanup: true
file:
- pegnetd-darwin-10.6-amd64
- pegnetd-linux-amd64
- pegnetd-windows-4.0-amd64.exe
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"