xUnholy/go-proxy

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: go

# Force-enable Go modules. This will be unnecessary when Go 1.12 lands.
env:
- GO111MODULE=on

# You don't need to test on very old version of the Go compiler. It's the user's
# responsibility to keep their compilers up to date.
go:
- 1.11.x

# Skip the install step. Don't `go get` dependencies. Only build with the code    
# in vendor/
install: true

# Anything in before_script that returns a nonzero exit code will flunk the    
# build and immediately stop. It's sorta like having set -e enabled in bash.    
# Make sure golangci-lint is vendored.
before_script:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh |
  sh -s -- -b $(go env GOPATH)/bin v1.15.0
- go get github.com/mattn/goveralls
- make modules

# Script always runs to completion (set +e). If we have linter issues AND a    
# failing test, we want to see both. Configure golangci-lint with a    
# .golangci.yml file at the top level of your repo.
script:
- golangci-lint run           # Run a bunch of code checkers/linters in parallel
- make all         # Run go build to compile binary file & execute all the tests with the race detector enabled
- "$GOPATH/bin/goveralls -service=travis-ci"

before_deploy:
- make releases
- if ! [[ $TRAVIS_TAG ]]; then
    export TRAVIS_TAG="0.0.1-$TRAVIS_BUILD_NUMBER" &&
    git config --local user.name "$USER_NAME" &&
    git config --local user.email "$USER_EMAIL" &&
    git tag "$TRAVIS_TAG" "$TRAVIS_COMMIT";
  fi

deploy:
  provider: releases
  api_key:
    secure: EGsQeDz6vC/tB2ioyWAURsrbFtd2K0utbhWH2pl8gr6Rwy7D2qBz38QUq57iYP+1WI7QEeAn4L6HFug29fGNI4Q7sw2760qG69mqfNONJJRnvPYMKMx9hWHxGqo79bc5vaNieHFOlz3yN8rj3x3x45tRaGMHpC9HIFPxNIljl4CqAqX7DoEGW64xICwn846XgF1DFXcna9fnoAzr+yJMtujWxtCMmN/Oqs5J4p/g7N6Ld/sEOuR3gnXWOsbrAfUlYCyjzUq/yWCyIiSUNSrnCjVYUGa7G9i/U5rudVQm5uXYvVL00+GXZPJGpk4ZVCJFbebY6wz+YfJOB9iNYzK8nTzwUsHj/dlU4LNZoSyL3wm/HyCB8Ta3m9dgT7egqTpBolt4hPu0Wyzzota6c+g9JXcaDMPIldqEVMVxWpxjpf0jVwqLZcOlVqSta6Rspa8Cna/6XmMxe9yKgqoYpUb2AXDmHWbF6yUEZC1yt7biKg6qnaqgJSiMwpG9gXVEFRQeFVF563RBFcFKFNd446hAS/Uq8x4KAgimUAU2Ho6IyI6fZEEVXj6H2BlcFgpxH/tHMXVh66eL9uyIO/ws5RXNxvFT2v8H2Hof8Qo0qxM/ukJ+GOncRp0fnU9UMpKLhYbKGcHliVNBk6nanQq0OGczGwgAdqsp7isxhmZ/ugWhMKM=
  file: 
    - release/darwin/darwin-proxy.tar.gz
    - release/linux/linux-proxy.tar.gz
    - release/windows/windows-proxy.tar.gz
  # Make sure you have skip_cleanup set to true, otherwise Travis CI will delete all the files created during the build, which will probably delete what you are trying to upload.
  skip_cleanup: true
  # Overwrite existing files
  overwrite: true
  on:
    repo: xUnholy/go-proxy
    # Only deploy when on matching branch selector
    branch: master
    # With on.tags: true, your Releases deployment will trigger if and only if the build is a tagged build.
    tags: true