-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automated release using travis (#49)
- Loading branch information
1 parent
0b3d3fb
commit 4d60d3e
Showing
2 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters