-
Notifications
You must be signed in to change notification settings - Fork 109
/
.drone.yml
82 lines (71 loc) · 1.59 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
---
kind: pipeline
type: docker
name: sx-ci
trigger:
ref:
- refs/heads/master
- refs/pull/*/head
- refs/tags/*
event:
- push
- tag
- pull_request
clone:
depth: 1
steps:
- name: lint
image: golangci/golangci-lint:v1.49-alpine
volumes:
- name: deps
path: /go
commands:
- apk add libpcap-dev libc-dev linux-headers
- golangci-lint run -v
- go install github.com/mgechev/[email protected]
- revive -config .revive.toml -formatter friendly ./...
- name: test & build
image: golang:1.19-alpine
volumes:
- name: deps
path: /go
commands:
- apk add libpcap-dev libc-dev gcc linux-headers
- 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 libpcap-dev libc-dev gcc linux-headers 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:
- sx-ci
trigger:
event:
- tag
steps:
- name: fetch
image: alpine/git
commands:
- git fetch --tags
- name: release
image: golang:1.19-alpine
environment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- apk add libpcap-dev libc-dev gcc linux-headers curl git
- curl -s https://raw.githubusercontent.com/goreleaser/get/master/get | sh