-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
125 lines (109 loc) · 2.07 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
kind: pipeline
name: default
golang-image: &golang-image golang:1.17-alpine
gobin-volume: &gobin-volume
name: gobin
path: /go/bin
usr-volume: &usr-volume
name: usr
path: /usr
docker-volume: &docker-volume
name: dockersock
path: /var/run
deps-command: &deps-command apk add build-base git docker
steps:
- name: tags
image: alpine/git
commands:
- git fetch --tags
- name: install-tools
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- *deps-command
- make install-tools
- name: lint
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- make lint
depends_on:
- tags
- install-tools
- name: test
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- make test
- make coverage
depends_on:
- install-tools
- tags
- lint
- name: build
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- make build
depends_on:
- tags
- lint
- test
- install-tools
when:
event:
exclude:
- tag
- name: release
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
- *docker-volume
environment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- /bin/sh -c "echo $GITHUB_TOKEN | docker login ghcr.io -u xsteadfastx --password-stdin"
- docker ps -a
- goreleaser --debug release --rm-dist
depends_on:
- tags
- lint
- test
- install-tools
when:
event:
- tag
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook_url
channel: xsfx-alerts
depends_on:
- build
- release
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: gobin
temp: {}
- name: usr
temp: {}
- name: dockersock
temp: {}