Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added automated release using travis #49

Merged
merged 1 commit into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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