From 2762348654021b16afc253d181504eab7b05222e Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Fri, 24 Nov 2017 11:13:33 +0800 Subject: [PATCH] travis: use build stages and publish release automatically --- .travis.yml | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4af32b1c..c174bc57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ language: go -go_import_path: github.com/getamis/istanbul-tools sudo: required -os: linux -dist: trusty go: - - 1.7.6 - - 1.8.3 + - 1.7 + - 1.8 + - 1.9 env: - TEST=unit - TEST=istanbul @@ -20,15 +18,33 @@ install: script: - 'if [ ${TEST} = "unit" ]; then - travis_wait 30 go test -v $(glide novendor | grep -v "\.\/tests\/\.\.\.") --timeout 30m; - elif [ ${TEST} = "istanbul" ]; then - cd ${TRAVIS_BUILD_DIR}/tests/functional && travis_wait 120 ginkgo -r --progress; - elif [ ${TEST} = "quorum" ]; then - cd ${TRAVIS_BUILD_DIR}/tests/quorum && travis_wait 120 ginkgo -r --progress; - else - echo "Invalid env" - exit 2; - fi' + travis_wait 30 go test -v $(glide novendor | grep -v "\.\/tests\/\.\.\.") --timeout 30m; + elif [ ${TEST} = "istanbul" ]; then + cd ${TRAVIS_BUILD_DIR}/tests/functional && travis_wait 120 ginkgo -r --progress; + elif [ ${TEST} = "quorum" ]; then + cd ${TRAVIS_BUILD_DIR}/tests/quorum && travis_wait 120 ginkgo -r --progress; + else + echo "Invalid env" + exit 2; + fi' +branches: + only: + - develop + +jobs: + include: + - stage: release + go: 1.9 + if: tag =~ ^v + env: + - TEST=none + - REV="$TRAVIS_TAG" + deploy: + provider: releases + api_key: "$GITHUB_OAUTH_TOKEN" + skip_cleanup: true + on: + tags: true notifications: webhooks: