From de75b778c06df04200d036433c69f8a1f254c59b Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 24 Dec 2017 13:37:47 -0800 Subject: [PATCH] Only deploy with one version of Go --- .travis.yml | 15 +++++++++++---- etc/travis-deploy.sh | 10 ++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 etc/travis-deploy.sh diff --git a/.travis.yml b/.travis.yml index a407e1f..59d36e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,21 @@ language: go sudo: false +env: + - DEPLOY_WITH_MAJOR="1.9" + before_script: - go vet ./... go: - - 1.8.5 - - 1.9.2 + - 1.8.x + - 1.9.x script: go test -race -v ./... -after_success: - - test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash +deploy: + provider: script + script: etc/travis-deploy.sh + on: + tags: true + branch: master diff --git a/etc/travis-deploy.sh b/etc/travis-deploy.sh new file mode 100755 index 0000000..e93c363 --- /dev/null +++ b/etc/travis-deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# travis-deploy.sh +# description: Trigger goreleaser deployment in correct build scenarios + +set -eo pipefail +set -x + +if [[ "$TRAVIS_GO_VERSION" == "$DEPLOY_WITH_MAJOR."* ]]; then + curl -sL https://git.io/goreleaser | bash +fi