mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
travis: Utilize build stages for deploy
This commit is contained in:
19
.travis.yml
19
.travis.yml
@@ -9,17 +9,22 @@ addons:
|
|||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- GO111MODULE=on
|
- GO111MODULE=on
|
||||||
- DEPLOY_WITH_MAJOR="1.11"
|
|
||||||
|
|
||||||
before_script:
|
install:
|
||||||
- go get golang.org/x/lint/golint
|
- go get golang.org/x/lint/golint
|
||||||
- make deps
|
- make deps
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- "1.11.x"
|
- "1.11.x"
|
||||||
|
- "tip"
|
||||||
|
|
||||||
deploy:
|
jobs:
|
||||||
provider: script
|
include:
|
||||||
script: etc/travis-deploy.sh
|
- stage: deploy
|
||||||
on:
|
script: etc/travis-deploy.sh
|
||||||
tags: true
|
go: "1.11.x"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- name: deploy
|
||||||
|
if: tag IS present
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# travis-deploy.sh
|
# travis-deploy.sh
|
||||||
# description: Trigger goreleaser deployment in correct build scenarios
|
# description: Trigger goreleaser deployment
|
||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
if [[ "$TRAVIS_GO_VERSION" == "$DEPLOY_WITH_MAJOR."* ]]; then
|
# downloading deps probably added to go.mod and go.sum, goreleaser will fail.
|
||||||
curl -sL https://git.io/goreleaser | bash
|
git reset --hard
|
||||||
fi
|
git clean -dfx
|
||||||
|
|
||||||
|
# build release.
|
||||||
|
curl -sL https://git.io/goreleaser | bash
|
||||||
|
|||||||
Reference in New Issue
Block a user