This repository has been archived by the owner on Apr 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
88 lines (86 loc) · 1.72 KB
/
.drone.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
kind: pipeline
name: durl
steps:
- name: durl
image: quay.io/suzuki_shunsuke/durl:1.0.0
commands:
- sh scripts/durl.sh
---
kind: pipeline
name: build
volumes:
- name: gopath
temp: {}
steps:
- name: download go modules
image: golang:1.15.4
commands:
- go mod download
volumes: &volumes
- name: gopath
path: /go
environment:
GOPATH: /go
- name: golangci-lint
image: golangci/golangci-lint:v1.32.2-alpine
commands:
- golangci-lint run
environment:
GOPATH: /go
volumes: *volumes
- name: codecov
image: golang:1.15.4
commands:
# bash and cgo seem to be required
- bash scripts/codecov-test.sh
- curl -s https://codecov.io/bash > /tmp/codecov.sh
- test "$LOCAL" = "true" -o "$DRONE_BUILD_EVENT" = "pull_request" || bash /tmp/codecov.sh
environment:
GOPATH: /go
CODECOV_TOKEN:
from_secret: codecov_token
volumes: *volumes
- name: remove changes
image: &image_git plugins/git
commands:
# Sometimes it is failed to release by goreleaser due to changes of go.sum
- git checkout -- .
- name: fetch tags to release
image: *image_git
commands:
- git fetch --tags
when:
event:
- tag
- name: release
image: goreleaser/goreleaser:v0.146.0
commands:
- goreleaser release
environment:
GOPATH: /go
GITHUB_TOKEN:
from_secret: github_token
volumes: *volumes
when:
event:
- tag
- name: create a dummy tag to test releasing
image: *image_git
commands:
- git tag v0.1.0-alpha
when:
event:
- pull_request
- push
- name: release (skip publish)
image: goreleaser/goreleaser:v0.146.0
commands:
- goreleaser release --skip-publish
environment:
GOPATH: /go
volumes: *volumes
when:
event:
- pull_request
- push