-
Notifications
You must be signed in to change notification settings - Fork 23
/
.drone.yml
36 lines (33 loc) · 917 Bytes
/
.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
kind: pipeline
type: docker
name: build
steps:
- name: lint
image: golang:1.14-alpine
commands:
- go get golang.org/x/lint/golint github.com/securego/gosec/cmd/gosec
- test -z $(gofmt -l .)
- golint -set_exit_status ./...
- gosec -quiet ./...
- name: prepare and build
image: golang:1.14-alpine
commands:
- go get github.com/mitchellh/gox
- go get -v -d ./...
- mkdir -p dist
- arch=$(go tool dist list |
tr "\n" " " |
sed -r "s~((android|nacl)/\w+|darwin/arm(64)?)~~g" |
xargs)
- version=$(if [ -z "$DRONE_TAG" ]; then echo $DRONE_COMMIT; else echo $DRONE_TAG; fi)
- gox -parallel=16 -osarch="$arch" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.version=$version" ./...
environment:
CGO_ENABLED: 0
- name: release binaries
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: dist/*
when:
event: tag