Skip to content

Commit

Permalink
Update travis
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah committed Jun 8, 2018
1 parent 4deed23 commit 944f401
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
language: go
sudo: false
sudo: true
matrix:
include:
- go: 1.x
env: LATEST=true
- go: 1.9
- go: 1.8

before_install:
- go get github.com/mitchellh/gox # go tool for cross compiling
- go get github.com/mattn/go-isatty # needed for progress bar in windows
- go get github.com/inconshreveable/mousetrap # needed for windows builds
- sudo apt install gcc-mingw-w64

install:
- go get github.com/RadhiFadlillah/shiori

script:
- go generate
- go get -t -v ./...
- diff -u <(echo -n) <(gofmt -d .)
- go vet $(go list ./... | grep -v /vendor/)
- go test -v -race ./...
# only build binaries from the latest Go release.
- if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -output "shiori_{{.OS}}_{{.Arch}}" -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...; fi
- if [ "${LATEST}" = "true" ]; then
env GOARCH=386 go build -o shiori_linux_386;
env GOARCH=amd64 go build -o shiori_linux_amd64;
env GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc go build -o shiori_windows_386.exe;
env GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc go build -o shiori_windows_amd64.exe;
fi

deploy:
provider: releases
skip_cleanup: true
api_key:
secure: $TOKEN
file:
- shiori_windows_amd64.exe
- shiori_darwin_amd64
- shiori_linux_386
- shiori_linux_amd64
- shiori_windows_386.exe
- shiori_windows_amd64.exe
on:
tags: true
branches:
Expand Down

0 comments on commit 944f401

Please sign in to comment.