Skip to content

Commit d199ef1

Browse files
committed
Create pipeline drone-github-release-harness
1 parent ccfc07d commit d199ef1

File tree

1 file changed

+383
-0
lines changed

1 file changed

+383
-0
lines changed

.harness/harness.yaml

Lines changed: 383 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,383 @@
1+
pipeline:
2+
name: drone-github-release-harness
3+
identifier: dronegithubreleaseharness
4+
projectIdentifier: Drone_Plugins
5+
orgIdentifier: default
6+
tags: {}
7+
properties:
8+
ci:
9+
codebase:
10+
connectorRef: GitHub_Drone_Plugins_Org
11+
repoName: drone-github-release
12+
build: <+input>
13+
sparseCheckout: []
14+
stages:
15+
- stage:
16+
name: Testing Stage
17+
identifier: Testing_Stage
18+
type: CI
19+
spec:
20+
cloneCodebase: true
21+
caching:
22+
enabled: false
23+
paths: []
24+
platform:
25+
os: Linux
26+
arch: Amd64
27+
runtime:
28+
type: Cloud
29+
spec: {}
30+
execution:
31+
steps:
32+
- step:
33+
type: Run
34+
name: Lint
35+
identifier: Lint
36+
spec:
37+
connectorRef: Plugins_Docker_Hub_Connector
38+
image: golang:1.20
39+
shell: Sh
40+
command: |-
41+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
42+
golangci-lint version
43+
golangci-lint run
44+
- step:
45+
type: Run
46+
name: Test
47+
identifier: Run_1
48+
spec:
49+
connectorRef: Plugins_Docker_Hub_Connector
50+
image: golang:1.20
51+
shell: Sh
52+
command: go test -cover ./...
53+
description: ""
54+
- parallel:
55+
- stage:
56+
name: linux-amd64
57+
identifier: linuxamd64
58+
type: CI
59+
spec:
60+
cloneCodebase: true
61+
caching:
62+
enabled: false
63+
paths: []
64+
platform:
65+
os: Linux
66+
arch: Amd64
67+
runtime:
68+
type: Cloud
69+
spec: {}
70+
execution:
71+
steps:
72+
- step:
73+
name: Build binaries
74+
identifier: Build_binaries
75+
type: Run
76+
spec:
77+
connectorRef: Plugins_Docker_Hub_Connector
78+
image: golang:1.20
79+
shell: Sh
80+
command: |-
81+
# force go modules
82+
export GOPATH=""
83+
84+
# disable cgo
85+
export CGO_ENABLED=0
86+
87+
set -e
88+
set -x
89+
90+
# linux
91+
export GOOS=linux GOARCH=amd64
92+
go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-github-release ./cmd/drone-github-release
93+
when:
94+
stageStatus: Success
95+
- step:
96+
type: Plugin
97+
name: BuildAndPushDockerPlugin
98+
identifier: BuildAndPushDockerPlugin
99+
spec:
100+
connectorRef: Plugins_Docker_Hub_Connector
101+
image: plugins/docker
102+
settings:
103+
username: drone
104+
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
105+
repo: plugins/github-release
106+
dockerfile: docker/Dockerfile.linux.amd64
107+
auto_tag: "true"
108+
auto_tag_suffix: linux-amd64
109+
when:
110+
stageStatus: Success
111+
condition: <+codebase.build.type> == "tag"
112+
- step:
113+
type: BuildAndPushDockerRegistry
114+
name: BuildAndPushDockerRegistry
115+
identifier: BuildAndPushDockerRegistry
116+
spec:
117+
connectorRef: Plugins_Docker_Hub_Connector
118+
repo: plugins/github-release
119+
tags:
120+
- linux-amd64
121+
caching: false
122+
dockerfile: docker/Dockerfile.linux.amd64
123+
when:
124+
stageStatus: Success
125+
condition: |
126+
<+codebase.build.type> == "branch"
127+
description: ""
128+
- stage:
129+
name: linux-arm64
130+
identifier: linuxarm64
131+
type: CI
132+
spec:
133+
cloneCodebase: true
134+
caching:
135+
enabled: false
136+
paths: []
137+
platform:
138+
os: Linux
139+
arch: Arm64
140+
runtime:
141+
type: Cloud
142+
spec: {}
143+
execution:
144+
steps:
145+
- step:
146+
name: Build binaries
147+
identifier: Build_binaries
148+
type: Run
149+
spec:
150+
connectorRef: Plugins_Docker_Hub_Connector
151+
image: golang:1.20
152+
shell: Sh
153+
command: |-
154+
# force go modules
155+
export GOPATH=""
156+
157+
# disable cgo
158+
export CGO_ENABLED=0
159+
160+
set -e
161+
set -x
162+
163+
# linux
164+
export GOOS=linux GOARCH=arm64
165+
go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-github-release ./cmd/drone-github-release
166+
when:
167+
stageStatus: Success
168+
- step:
169+
type: Plugin
170+
name: BuildAndPushDockerPlugin
171+
identifier: BuildAndPushDockerPlugin
172+
spec:
173+
connectorRef: Plugins_Docker_Hub_Connector
174+
image: plugins/docker
175+
settings:
176+
username: drone
177+
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
178+
repo: plugins/github-release
179+
dockerfile: docker/Dockerfile.linux.arm64
180+
auto_tag: "true"
181+
auto_tag_suffix: linux-arm64
182+
when:
183+
stageStatus: Success
184+
condition: <+codebase.build.type> == "tag"
185+
- step:
186+
type: BuildAndPushDockerRegistry
187+
name: BuildAndPushDockerRegistry
188+
identifier: BuildAndPushDockerRegistry
189+
spec:
190+
connectorRef: Plugins_Docker_Hub_Connector
191+
repo: plugins/github-release
192+
tags:
193+
- linux-arm64
194+
caching: false
195+
dockerfile: docker/Dockerfile.linux.arm64
196+
when:
197+
stageStatus: Success
198+
condition: |
199+
<+codebase.build.type> == "branch"
200+
description: ""
201+
- stage:
202+
name: windows-1809-amd64
203+
identifier: windows1809amd64
204+
type: CI
205+
spec:
206+
cloneCodebase: true
207+
caching:
208+
enabled: false
209+
paths: []
210+
execution:
211+
steps:
212+
- step:
213+
name: Build binaries
214+
identifier: Build_binaries
215+
type: Run
216+
spec:
217+
connectorRef: Plugins_Docker_Hub_Connector
218+
image: golang:1.20
219+
shell: Sh
220+
command: |-
221+
# force go modules
222+
export GOPATH=""
223+
224+
# disable cgo
225+
export CGO_ENABLED=0
226+
227+
set -e
228+
set -x
229+
230+
# Windows
231+
GOOS=windows
232+
go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-github-release.exe ./cmd/drone-github-release
233+
when:
234+
stageStatus: Success
235+
- step:
236+
type: Plugin
237+
name: BuildAndPushDockerPlugin
238+
identifier: BuildAndPushDockerPlugin
239+
spec:
240+
connectorRef: Plugins_Docker_Hub_Connector
241+
image: plugins/docker
242+
settings:
243+
username: drone
244+
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
245+
repo: plugins/github-release
246+
dockerfile: docker/Dockerfile.windows.1809
247+
auto_tag: "true"
248+
auto_tag_suffix: windows-1809-amd64
249+
when:
250+
stageStatus: Success
251+
condition: <+codebase.build.type> == "tag"
252+
- step:
253+
type: BuildAndPushDockerRegistry
254+
name: BuildAndPushDockerRegistry
255+
identifier: BuildAndPushDockerRegistry
256+
spec:
257+
connectorRef: Plugins_Docker_Hub_Connector
258+
repo: plugins/github-release
259+
tags:
260+
- windows-1809-amd64
261+
caching: false
262+
dockerfile: docker/Dockerfile.windows.1809
263+
when:
264+
stageStatus: Success
265+
condition: |
266+
<+codebase.build.type> == "branch"
267+
infrastructure:
268+
type: VM
269+
spec:
270+
type: Pool
271+
spec:
272+
poolName: windows-2019
273+
os: Windows
274+
description: ""
275+
delegateSelectors:
276+
- windows-vm
277+
- stage:
278+
name: windows-ltsc2022-amd64
279+
identifier: windowsltsc2022amd64
280+
type: CI
281+
spec:
282+
cloneCodebase: true
283+
caching:
284+
enabled: false
285+
paths: []
286+
platform:
287+
os: Windows
288+
arch: Amd64
289+
runtime:
290+
type: Cloud
291+
spec: {}
292+
execution:
293+
steps:
294+
- step:
295+
name: Build binaries
296+
identifier: Build_binaries
297+
type: Run
298+
spec:
299+
connectorRef: Plugins_Docker_Hub_Connector
300+
image: golang:1.20
301+
shell: Sh
302+
command: |-
303+
# force go modules
304+
export GOPATH=""
305+
306+
# disable cgo
307+
export CGO_ENABLED=0
308+
309+
set -e
310+
set -x
311+
312+
# Windows
313+
GOOS=windows
314+
go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-github-release.exe ./cmd/drone-github-release
315+
- step:
316+
type: Plugin
317+
name: BuildAndPushDockerPlugin
318+
identifier: BuildAndPushDockerPlugin
319+
spec:
320+
connectorRef: Plugins_Docker_Hub_Connector
321+
image: plugins/docker
322+
settings:
323+
username: drone
324+
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
325+
repo: plugins/github-release
326+
dockerfile: docker/Dockerfile.windows.ltsc2022
327+
auto_tag: "true"
328+
auto_tag_suffix: windows-ltsc2022-amd64
329+
when:
330+
stageStatus: Success
331+
condition: <+codebase.build.type> == "tag"
332+
- step:
333+
type: BuildAndPushDockerRegistry
334+
name: BuildAndPushDockerRegistry
335+
identifier: BuildAndPushDockerRegistry
336+
spec:
337+
connectorRef: Plugins_Docker_Hub_Connector
338+
repo: plugins/github-release
339+
tags:
340+
- windows-ltsc2022-amd64
341+
caching: false
342+
dockerfile: docker/Dockerfile.windows.ltsc2022
343+
when:
344+
stageStatus: Success
345+
condition: |
346+
<+codebase.build.type> == "branch"
347+
description: ""
348+
- stage:
349+
name: Manifest
350+
identifier: Manifest
351+
type: CI
352+
spec:
353+
cloneCodebase: true
354+
caching:
355+
enabled: false
356+
paths: []
357+
platform:
358+
os: Linux
359+
arch: Amd64
360+
runtime:
361+
type: Cloud
362+
spec: {}
363+
execution:
364+
steps:
365+
- step:
366+
type: Plugin
367+
name: Manifest
368+
identifier: Manifest
369+
spec:
370+
connectorRef: Plugins_Docker_Hub_Connector
371+
image: plugins/manifest
372+
settings:
373+
username: drone
374+
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
375+
auto_tag: "true"
376+
ignore_missing: "true"
377+
spec: docker/manifest.tmpl
378+
when:
379+
stageStatus: Success
380+
condition: |
381+
<+codebase.build.type> == "tag" || <+codebase.build.type> == "branch"
382+
description: ""
383+
allowStageExecutions: true

0 commit comments

Comments
 (0)