This repository has been archived on 2019-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
gop/.drone.yml
Lunny Xiao df11fdc044
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
lunny/gop_release (#35)
2019-08-27 06:37:58 +00:00

133 lines
2.4 KiB
YAML

---
kind: pipeline
name: testing
platform:
os: linux
arch: amd64
workspace:
base: /go
path: src/gitea.com/lunny/gop
steps:
- name: test_go1.10
pull: always
image: golang:1.10
commands:
- go get -t -d -v
- go build -v
- go test -v -race
environment:
GO111MODULE: off
volumes:
- name: gopath
path: /go
- name: test_go1.11
pull: always
image: golang:1.11
commands:
- go get -t -d -v
- go build -v
- go test -v -race
environment:
GO111MODULE: off
volumes:
- name: gopath
path: /go
- name: test_go1.11mod
pull: always
image: golang:1.11
commands:
- go build -mod=vendor -v
- go test -mod=vendor -v -race
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
volumes:
- name: gopath
path: /go
- name: test_go1.12
pull: always
image: golang:1.12
commands:
- go get -t -d -v
- go build -v
- go test -v -race
environment:
GO111MODULE: off
volumes:
- name: gopath
path: /go
- name: test_go1.12mod
pull: always
image: golang:1.12
commands:
- go build -mod=vendor -v
- go test -mod=vendor -v -race
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
volumes:
- name: gopath
path: /go
- name: docker-dryrun
pull: always
image: plugins/docker:17.12
settings:
cache_from: lunny/gop
dry_run: true
repo: lunny/gop
when:
event:
- pull_request
- name: release_build
pull: always
image: golang:1.12
commands:
- go build -mod=vendor -o dist/gop-${DRONE_TAG}-darwin-10.6-amd64
- GOOS=linux GOARCH=amd64 go build -mod=vendor -o dist/gop-${DRONE_TAG}-linux-amd64
- GOOS=windows GOARCH=amd64 go build -mod=vendor -o dist/gop-${DRONE_TAG}-windows-amd64.exe
environment:
GO111MODULE: on
volumes:
- name: gopath
path: /go
when:
event: tag
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.com
files: dist/*
when:
event: tag
- name: release-docker
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
cache_from: lunny/gop
repo: lunny/gop
build_args:
- GOPROXY=off
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
when:
event:
exclude:
- pull_request