添加Travis CI

pull/25/merge
lifei6671 2017-05-08 17:19:02 +08:00
parent 4817ab2fcc
commit 2c55dbdea3
1 changed files with 33 additions and 0 deletions

33
.travis.yml 100644
View File

@ -0,0 +1,33 @@
language: go
go:
- 1.8
before_install:
- sudo apt-get -qq update
- go get -v -u ./...
- GOARCH=amd64 GOOS=linux go build -o godoc_linux_amd64 -ldflags="-w -X main.VERSION=$TAG -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'"
- GOARCH=amd64 GOOS=darwin go build -o godoc_darwin_amd64 -ldflags="-w -X main.VERSION=$TAG -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'"
- GOARCH=amd64 GOOS=windows go build -o godoc_windows_amd64 -ldflags="-w -X main.VERSION=$TAG -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'"
- rm -rf commands controllers models modules routers tasks vendor docs search data utils graphics .git Godeps uploads/* .gitignore .travis.yml Dockerfile gide.yaml LICENSE main.go README.md conf/enumerate.go conf/mail.go install.lock *.md
- zip -r godoc_linux_amd64.zip conf logs static uploads views godoc_linux_amd64
- zip -r godoc_darwin_amd64.zip conf logs static uploads views godoc_darwin_amd64
- zip -r godoc_windows_amd64.zip conf logs static uploads views godoc_windows_amd64
deploy:
provider: releases
api_key: $CI_USER_TOKEN
skip_cleanup: true
file:
- godoc_linux_amd64.zip
- godoc_darwin_amd64.zip
- godoc_windows_amd64.zip
on:
overwrite: true
tags: true
all_branches: true
go: 1.8
env:
global:
- TAG: 0.1.2