-
Notifications
You must be signed in to change notification settings - Fork 10
/
.drone.yml
76 lines (66 loc) · 1.29 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
---
kind: pipeline
type: docker
name: wirez-ci
trigger:
ref:
- refs/heads/main
- refs/pull/*/head
- refs/tags/*
event:
- push
- tag
- pull_request
clone:
depth: 1
steps:
- name: lint
image: golangci/golangci-lint:v1.50-alpine
volumes:
- name: deps
path: /go
commands:
- golangci-lint run -v
- name: test & build
image: golang:1.19-alpine
environment:
CGO_ENABLED: "0"
volumes:
- name: deps
path: /go
commands:
- go test ./... -v -cover
- go build -ldflags "-w -s"
- name: goreleaser-snapshot
image: golang:1.19-alpine
volumes:
- name: deps
path: /go
commands:
- apk add curl git
- curl -s https://raw.githubusercontent.com/goreleaser/get/master/get > goreleaser.sh
- chmod +x goreleaser.sh && ./goreleaser.sh --snapshot
when:
event: push
volumes:
- name: deps
temp: {}
---
kind: pipeline
type: docker
name: release
depends_on:
- wirez-ci
trigger:
event:
- tag
steps:
- name: release
image: golang:1.19-alpine
environment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- apk add curl git
- git fetch --tags
- curl -s https://raw.githubusercontent.com/goreleaser/get/master/get | sh