chore: Fix release flow (retry)

This commit is contained in:
tsuyoshiwada 2018-02-28 23:18:25 +09:00
parent 790a2e6574
commit 40598132fc
2 changed files with 16 additions and 15 deletions

View file

@ -6,17 +6,20 @@ go:
- 1.9
before_install:
- go get github.com/mattn/goveralls
- go get github.com/mitchellh/gox
- go get github.com/tcnksm/ghr
before_script:
- export TZ=Asia/Tokyo
- sudo timedatectl set-timezone Asia/Tokyo
- timedatectl
script:
- make test
- goveralls -service=travis-ci
branches:
only:
- master
after_success:
- ./scripts/release.sh
- goveralls -service=travis-ci
before_deploy:
- go get github.com/mitchellh/gox
- go get github.com/tcnksm/ghr
deploy:
provider: script
script: ./scripts/release.sh
on:
tags: true
branch: master

View file

@ -2,11 +2,9 @@
REPO_ROOT=$(git rev-parse --show-toplevel)
if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_TAG" != "" ]] && [[ "$TRAVIS_PULL_REQUEST" == "" ]]; then
echo "Start release ..."
gox -os="darwin linux windows" -arch="amd64 386" -output="$REPO_ROOT/dist/{{.Dir}}_{{.OS}}_{{.Arch}}" ./cmd/git-chglog
ghr --username git-chglog --token $GITHUB_TOKEN --replace `grep 'Version =' ./cmd/git-chglog/version.go | sed -E 's/.*"(.+)"$$/\1/'` dist/
echo "Released!"
else
echo "Skip release"
fi
echo "Start release ..."
gox -os="darwin linux windows" -arch="amd64 386" -output="$REPO_ROOT/dist/{{.Dir}}_{{.OS}}_{{.Arch}}" ./cmd/git-chglog
ghr --username git-chglog --token $GITHUB_TOKEN --replace `grep 'Version =' ./cmd/git-chglog/version.go | sed -E 's/.*"(.+)"$$/\1/'` dist/
echo "Released!"