Skip to content

Commit

Permalink
Added automated release using travis (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinapathak authored Dec 5, 2019
1 parent 0b3d3fb commit 4d60d3e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
40 changes: 30 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 "[email protected]"
- 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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4d60d3e

Please sign in to comment.