-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
53 lines (47 loc) · 1.41 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
49
50
51
52
53
language: go
os:
- linux
go:
- "1.10.x"
- "1.9"
before_cache:
- rm -rf $GOPATH/src/github.com/yujiahaol68/rossy/*
- rm -rf $GOPATH/pkg/**/github.com/yujiahaol68/rossy
- rm -rf $GOPATH/src/github.com/mattn/go-sqlite3
cache:
directories:
- $GOPATH/src
- $GOPATH/pkg
before_install:
- go get github.com/mitchellh/gox
- go get github.com/inconshreveable/mousetrap
- go get github.com/mattn/goveralls
- mkdir data
- curl "https://api.mockaroo.com/api/278745a0?count=10&key=c32fb840" > source.json
- curl "https://api.mockaroo.com/api/0249e820?count=200&key=c32fb840" > post.json
- curl "https://api.mockaroo.com/api/7f1258e0?count=6&key=c32fb840" > category.json
- mv *.json data/
script:
- mv data ./app/database
- go get -t -v ./...
- go test github.com/yujiahaol68/rossy/app/database
- rm -f ./app/database/db_test.go
- $GOPATH/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN
- go build -ldflags "-X thirdparty.Key=${MERCURY_API_TOKEN}" main.go
before_deploy:
- gox -tags="jsoniter" -ldflags="-X thirdparty.Key=${MERCURY_API_TOKEN}" -os="linux darwin windows" -arch="amd64" -output="rossy_{{.OS}}_{{.Arch}}" -verbose ./...
- du -sh * | grep -e "darwin" -e "linux" -e "windows"
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: $AUTH_TOKEN
file:
- rossy_windows_amd64.exe
- rossy_darwin_amd64
- rossy_linux_amd64
on:
tags: true
branches:
only:
- release