Skip to content

Commit 29a7052

Browse files
committed
add build and publish steps
1 parent 301de9c commit 29a7052

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

.drone.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
1+
---
12
kind: pipeline
23
type: kubernetes
3-
name: backend
4+
name: default
45

56
steps:
67
- name: lint
78
image: golangci/golangci-lint:latest-alpine
89
commands:
910
- golangci-lint run --enable-all --disable gomnd
10-
- name: test-build
11+
- name: test
1112
image: golang:1-alpine
1213
commands:
1314
- CGO_ENABLED=0 go test -json -coverprofile=coverage.out ./... >tests.json
14-
- CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" .
15+
- name: build
16+
image: golang:1-alpine
17+
commands:
18+
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-s -w" -o dist/github-latest_linux_amd64
19+
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo -ldflags="-s -w" -o dist/github-latest_linux_arm64
20+
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-s -w" -o dist/github-latest_darwin_amd64
21+
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-s -w" -o dist/github-latest_windows_amd64
22+
depends_on:
23+
- lint
24+
- test
25+
- name: publish
26+
image: plugins/github-release
27+
settings:
28+
api_key:
29+
from_secret: github_access_token
30+
files: dist/*
31+
checksum:
32+
- sha256
33+
title: ${DRONE_TAG}
34+
depends_on:
35+
- build
36+
when:
37+
event: tag

0 commit comments

Comments
 (0)