-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (39 loc) · 1.38 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
language: go
os: linux
branches:
only:
- master
- develop
- /^ft-.*$/
- /^infra-.*$/
- /^fix-.*$/
- /^chore-.*$/
- /^feat-.*$/
before_install:
- go get github.com/caarlos0/svu
- go get github.com/mattn/goveralls
# Check commit matches expected commit (because of Travis bug)
- |
if [[ "$TRAVIS_COMMIT" != "$(git rev-parse HEAD)" ]]; then
echo "Commit $(git rev-parse HEAD) doesn't match expected commit $TRAVIS_COMMIT"
fi
script:
- curl --silent --fail --location https://git.io/goreleaser | sh -s -- check
- $GOPATH/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN
after_success:
- |
current_tag="$($GOPATH/bin/svu current)"
next_tag="$($GOPATH/bin/svu next)"
if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ $current_tag != $next_tag ]]; then
echo "On the master branch."
echo "Current tag: $current_tag"
echo "Next tag: $next_tag"
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/Eorate/shadowheart.git
git config user.email "Rodnee@example.com"
git config user.name "Rodnee"
echo "git tag -a $next_tag -m \"version $next_tag\""
git tag -a $next_tag -m "version $next_tag"
git push origin master --follow-tags
# Run go releaser
curl --silent --location https://git.io/goreleaser | bash
fi