evcc-io/.travis.yml

60 lines
1.3 KiB
YAML

language: go
go: "1.15"
go_import_path: github.com/andig/evcc
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
- $HOME/gopath/pkg/src
notifications:
email:
on_success: never
on_failure: change
env:
global:
- PATH=$HOME/gopath/bin:$PATH
before_install:
# Install linters and misspell
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin
- golangci-lint --version
- make install
script:
# build
- make
- go mod tidy
# ensure all changes are committed; currently disabled using <true>
- test -z "$(git status --porcelain)" || (git status; git diff; true)
before_deploy:
- curl -sfL https://raw.githubusercontent.com/ldez/seihon/master/godownloader.sh | bash -s -- -b $GOPATH/bin
- seihon --version
- |
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
docker login -u $DOCKER_USER -p $DOCKER_PASS
fi
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
- provider: script
skip_cleanup: true
script: make publish-images
on:
branch: master
tags: true
# always publish latest image
- provider: script
skip_cleanup: true
script: make publish-latest
on:
branch: master
tags: false