52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
language: go
|
|
|
|
go:
|
|
- 1.12.x
|
|
- 1.x
|
|
|
|
dist: xenial
|
|
|
|
services:
|
|
- docker
|
|
|
|
env:
|
|
- GO111MODULE=on
|
|
|
|
notifications:
|
|
email:
|
|
on_success: never
|
|
on_failure: change
|
|
|
|
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}
|
|
- golangci-lint --version
|
|
# Install Docker image multi-arch builder
|
|
- curl -sfL https://raw.githubusercontent.com/ldez/seihon/master/godownloader.sh | bash -s -- -b "${GOPATH}/bin" ${SEIHON_VERSION}
|
|
- seihon --version
|
|
|
|
install:
|
|
- echo "TRAVIS_GO_VERSION=$TRAVIS_GO_VERSION"
|
|
- go mod download
|
|
|
|
before_deploy:
|
|
- >
|
|
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
|
|
export BEFORE_DEPLOY_RUN=1;
|
|
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
|
|
fi
|
|
|
|
deploy:
|
|
- provider: script
|
|
skip_cleanup: true
|
|
script: curl -sL https://git.io/goreleaser | bash
|
|
on:
|
|
tags: true
|
|
condition: $TRAVIS_GO_VERSION =~ ^1\.x$
|
|
- provider: script
|
|
skip_cleanup: true
|
|
script: make publish-images
|
|
on:
|
|
tags: true
|
|
condition: $TRAVIS_GO_VERSION =~ ^1\.x$
|