From 4d60d3e803ba251bfc4b799f8135d798c8ca66ba Mon Sep 17 00:00:00 2001 From: kristinaspring Date: Thu, 5 Dec 2019 11:37:52 -0800 Subject: [PATCH] Added automated release using travis (#49) --- .travis.yml | 40 ++++++++++++++++++++++++++++++---------- CHANGELOG.md | 8 +++++++- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 34e2383..6a984ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,16 @@ language: go go: - - 1.12.x + - 1.13.x - tip -services: - - docker +os: + - linux branches: only: - master -matrix: - allow_failures: - - go: tip - fast_finish: true - install: - GO111MODULE=on go mod vendor @@ -24,6 +19,31 @@ script: - GO111MODULE=on go test -v -race -coverprofile=coverage.txt ./... after_success: - - go get github.com/haya14busa/goverage - - goverage -coverprofile=coverage.txt ./... - bash <(curl -s https://codecov.io/bash) + +jobs: + include: + - stage: tag + name: "Tag For Release" + if: branch = master && type = push + before_script: + - echo -e "machine github.com\n login $GH_TOKEN" > ~/.netrc + script: + - export OLD_VERSION=$(git describe --tags `git rev-list --tags --max-count=1` | tail -1 | sed 's/v\(.*\)/\1/') + - git config --global user.name "kristinaspring" + - git config --global user.email "kmspring57@gmail.com" + - 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 + - stage: release + name: "Make a Release" + if: branch != master + script: skip + deploy: + on: + all_branches: true + tags: true + provider: releases + api_key: "$GH_TOKEN" + skip_cleanup: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 451abfc..bec191d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v0.7.0] +- Modified URL in context to be a *url.URL [#47](https://github.com/xmidt-org/bascule/pull/47) +- Added a ParseURL function into the basculehttp constructor [#47](https://github.com/xmidt-org/bascule/pull/47) +- Added automated release using travis [#49](https://github.com/xmidt-org/bascule/pull/49) + ## [v0.6.0] - Prune use of unnecessary custom time.Duration @@ -63,7 +68,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added constructor, enforcer, and listener alice decorators - Basic code and structure established -[Unreleased]: https://github.com/xmidt-org/bascule/compare/v0.6.0...HEAD +[Unreleased]: https://github.com/xmidt-org/bascule/compare/v0.7.0...HEAD +[v0.7.0]: https://github.com/xmidt-org/bascule/compare/v0.6.0...v0.7.0 [v0.6.0]: https://github.com/xmidt-org/bascule/compare/v0.5.0...v0.6.0 [v0.5.0]: https://github.com/xmidt-org/bascule/compare/v0.4.0...v0.5.0 [v0.4.0]: https://github.com/xmidt-org/bascule/compare/v0.3.1...v0.4.0