This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.drone.yml
88 lines (75 loc) · 2.05 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
---
type: docker
kind: pipeline
name: test
workspace:
base: /go
path: src/github.com/adobe/go-starter
steps:
- name: dep
image: mcom/gobuilder:1.12
pull: always
commands: [ "make dep" ]
- name: lint
image: golangci/golangci-lint:v1.23-alpine
pull: always
commands: [ "golangci-lint run" ]
- name: test
image: mcom/gobuilder:1.12
pull: always
commands: [ "make test" ]
---
type: docker
kind: pipeline
name: release
workspace:
base: /go
path: src/github.com/adobe/go-starter
depends_on: [ test ]
trigger:
event: [ tag ]
status: [ "success"]
steps:
- name: dep
image: mcom/gobuilder:1.12
pull: always
commands: [ "make dep" ]
- name: build linux
image: mcom/gobuilder:1.12
pull: always
commands: [ "make build" ]
environment:
BUILDARGS: -a -installsuffix cgo
BUILDCOMMIT: ${DRONE_COMMIT_SHA:0:7}
BUILDLDFLAGS: -extldflags "-static"
BUILDOUTPREFIX: build/linux-amd64/
BUILDTAG: ${DRONE_TAG}
GOARCH: amd64
GOOS: linux
- name: build darwin
image: mcom/gobuilder:1.12cross
pull: always
commands: [ "make build" ]
environment:
BUILDCOMMIT: ${DRONE_COMMIT_SHA:0:7}
BUILDLDFLAGS: -linkmode external -s
BUILDOUTPREFIX: build/darwin-amd64/
BUILDTAG: ${DRONE_TAG}
CC: o64-clang
CXX: o64-clang++
GOARCH: amd64
GOOS: darwin
- name: make tarball
image: mcom/zipbuilder
commands:
- "tar -C build/darwin-amd64 -cvzf go-starter-darwin-amd64.tgz ."
- "tar -C build/linux-amd64 -cvzf go-starter-linux-amd64.tgz ."
- name: github release
image: socialengine/github-release
commands:
- github-release release --user adobe --repo go-starter --tag ${DRONE_TAG} --name ${DRONE_TAG}
- github-release upload --user adobe --repo go-starter --tag ${DRONE_TAG} --name go-starter-darwin-amd64.tgz --file ./go-starter-darwin-amd64.tgz
- github-release upload --user adobe --repo go-starter --tag ${DRONE_TAG} --name go-starter-linux-amd64.tgz --file ./go-starter-linux-amd64.tgz
environment:
GITHUB_RELEASE_VERSION: v0.7.2
GITHUB_TOKEN: { from_secret: github_token }