From bf8df4b466b9e368b911502b6516768e58fa6ac4 Mon Sep 17 00:00:00 2001 From: Jack Murdock Date: Wed, 2 Dec 2020 15:06:48 -0800 Subject: [PATCH] Update .travis.yml --- .travis.yml | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2ccae8..fa8deef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,55 @@ language: go go: - - 1.13.x + - 1.15.x - tip os: - linux - - osx -matrix: - allow_failures: - - go: tip - fast_finish: true +services: + - docker branches: only: - main - + - /^v[0-9]+\.[0-9]+\.[0-9]+$/ + script: - make style codecov +jobs: + fast_finish: true + allow_failures: + - go: tip + include: + - stage: tag + name: "Tag For Release" + if: branch = main && type = push + before_script: + - echo -e "machine github.com\n login $GH_TOKEN" > ~/.netrc + script: + - export OLD_VERSION=$(make version) + - git config --global user.name "xmidt-bot" + - git config --global user.email "$BOT_EMAIL" + - export TAG=$(cat CHANGELOG.md | perl -0777 -ne 'print "$1" if /.*## \[Unreleased\]\s+## \[(v\d+.\d+.\d+)\].*/s') + - export TODAY=`date +'%m/%d/%Y'` + - export NOTES=$(cat CHANGELOG.md | perl -0777 -ne 'print "$ENV{TODAY}\n\n$1\n" if /.*## \[$ENV{TAG}\]\s(.*?)\s+## \[(v\d+.\d+.\d+)\].*/s') + - if [[ "$TAG" != "" && "$TAG" != "$OLD_VERSION" ]]; then git tag -a "$TAG" -m "$NOTES"; git push origin --tags; echo $?; fi + after_success: skip + + - stage: release + name: "Make a Release" + if: branch != main + script: skip + before_deploy: + - make release-artifacts + deploy: + on: + all_branches: true + tags: true + provider: releases + api_key: "$GH_TOKEN" + file_glob: true + file: ./.ignore/* + skip_cleanup: true