language: go

go:
  - 1.9

before_install:
  - go get github.com/mitchellh/gox
  - go get github.com/tcnksm/ghr
  - go get golang.org/x/tools/cmd/cover
  - go get github.com/mattn/goveralls

script:
  - go test -v -covermode=count ./...
  # TODO: Resolve how to make the coverageprofile work with multiple packages
  # - go test -v -covermode=count -coverprofile=coverage.out ./...
  # - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN
after_success:
  - gox -ldflags "-X main.VersionString=$TRAVIS_TAG" -output "dist/{{.OS}}_{{.Arch}}_{{.Dir}}"
  - ghr --username ernoaapa --token $GITHUB_TOKEN --replace --prerelease --debug pre-release dist/
deploy:
  provider: script
  script: ghr --username ernoaapa --token $GITHUB_TOKEN --replace --debug $(git tag -l --contains HEAD) dist/
  on:
    tags: true

language: go

go:
  - 1.9

before_install:
  - go get github.com/mitchellh/gox
  - go get github.com/tcnksm/ghr
  - go get golang.org/x/tools/cmd/cover
  - go get github.com/mattn/goveralls

script:
  - go test -v -covermode=count ./...
  # TODO: Resolve how to make the coverageprofile work with multiple packages
  # - go test -v -covermode=count -coverprofile=coverage.out ./...
  # - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN
after_success:
  - gox -ldflags "-X main.VersionString=$TRAVIS_TAG" -output "dist/{{.OS}}_{{.Arch}}_{{.Dir}}"
  - ghr --username ernoaapa --token $GITHUB_TOKEN --replace --prerelease --debug pre-release dist/
deploy:
  provider: script
  skip_cleanup: true
  script: ghr --username ernoaapa --token $GITHUB_TOKEN --replace --debug $(git tag -l --contains HEAD) dist/
  on:
    tags: true

Use skip_cleanup in release deploy
Use skip_cleanup in release deploy
