Skip to content

Commit 7490aab

Browse files
author
TP Honey
authored
Merge pull request #143 from tphoney/move_to_harness
(fix) add better windows support and move to harness.drone.io
2 parents 94b2489 + 091f27f commit 7490aab

File tree

9 files changed

+296
-55
lines changed

9 files changed

+296
-55
lines changed

.drone.yml

Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
kind: pipeline
2+
type: vm
3+
name: testing
4+
platform:
5+
os: linux
6+
arch: amd64
7+
pool:
8+
use: ubuntu
9+
10+
steps:
11+
- name: static check
12+
image: golang:1.19
13+
pull: always
14+
commands:
15+
- go get honnef.co/go/tools/cmd/staticcheck
16+
- go run honnef.co/go/tools/cmd/staticcheck ./...
17+
volumes:
18+
- name: gopath
19+
path: "/go"
20+
- name: lint
21+
image: golang:1.19
22+
pull: always
23+
commands:
24+
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
25+
- golangci-lint version
26+
- golangci-lint run
27+
volumes:
28+
- name: gopath
29+
path: "/go"
30+
- name: test
31+
image: golang:1.19
32+
commands:
33+
- go test -cover ./...
34+
volumes:
35+
- name: gopath
36+
path: "/go"
37+
volumes:
38+
- name: gopath
39+
temp: {}
40+
trigger:
41+
ref:
42+
- refs/heads/master
43+
- refs/tags/**
44+
- refs/pull/**
45+
46+
---
47+
kind: pipeline
48+
type: vm
49+
name: linux-amd64
50+
platform:
51+
os: linux
52+
arch: amd64
53+
pool:
54+
use: ubuntu
55+
56+
steps:
57+
- name: environment
58+
image: golang:1.19
59+
pull: always
60+
environment:
61+
CGO_ENABLED: "0"
62+
commands:
63+
- go version
64+
- go env
65+
- name: build
66+
image: golang:1.19
67+
environment:
68+
CGO_ENABLED: "0"
69+
commands:
70+
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-github-release ./cmd/drone-github-release
71+
- name: executable
72+
image: golang:1.19
73+
commands:
74+
- ./release/linux/amd64/drone-github-release --help
75+
- name: docker
76+
image: plugins/docker
77+
settings:
78+
dockerfile: docker/Dockerfile.linux.amd64
79+
repo: plugins/github-release
80+
username:
81+
from_secret: docker_username
82+
password:
83+
from_secret: docker_password
84+
auto_tag: true
85+
auto_tag_suffix: linux-amd64
86+
when:
87+
ref:
88+
- refs/heads/master
89+
- refs/tags/**
90+
depends_on:
91+
- testing
92+
trigger:
93+
ref:
94+
- refs/heads/master
95+
- refs/tags/**
96+
- refs/pull/**
97+
98+
---
99+
kind: pipeline
100+
type: vm
101+
name: linux-arm64
102+
platform:
103+
os: linux
104+
arch: amd64
105+
pool:
106+
use: ubuntu_arm64
107+
108+
steps:
109+
- name: environment
110+
image: golang:1.19
111+
pull: always
112+
environment:
113+
CGO_ENABLED: "0"
114+
commands:
115+
- go version
116+
- go env
117+
- name: build
118+
image: golang:1.19
119+
environment:
120+
CGO_ENABLED: "0"
121+
commands:
122+
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-github-release ./cmd/drone-github-release
123+
- name: executable
124+
image: golang:1.19
125+
commands:
126+
- ./release/linux/arm64/drone-github-release --help
127+
- name: docker
128+
image: plugins/docker
129+
settings:
130+
dockerfile: docker/Dockerfile.linux.arm64
131+
repo: plugins/github-release
132+
username:
133+
from_secret: docker_username
134+
password:
135+
from_secret: docker_password
136+
auto_tag: true
137+
auto_tag_suffix: linux-arm64
138+
when:
139+
ref:
140+
- refs/heads/master
141+
- refs/tags/**
142+
depends_on:
143+
- testing
144+
trigger:
145+
ref:
146+
- refs/heads/master
147+
- refs/tags/**
148+
- refs/pull/**
149+
150+
---
151+
kind: pipeline
152+
type: vm
153+
name: windows-1809
154+
platform:
155+
os: windows
156+
arch: amd64
157+
pool:
158+
use: windows
159+
160+
steps:
161+
- name: environment
162+
image: golang:1.19
163+
pull: always
164+
environment:
165+
CGO_ENABLED: "0"
166+
commands:
167+
- go version
168+
- go env
169+
- name: build
170+
image: golang:1.19
171+
environment:
172+
CGO_ENABLED: "0"
173+
commands:
174+
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-github-release.exe ./cmd/drone-github-release
175+
- name: executable
176+
image: golang:1.19
177+
commands:
178+
- ./release/windows/amd64/drone-github-release.exe --help
179+
- name: docker
180+
image: plugins/docker
181+
settings:
182+
dockerfile: docker/Dockerfile.windows.1809
183+
repo: plugins/github-release
184+
username:
185+
from_secret: docker_username
186+
password:
187+
from_secret: docker_password
188+
auto_tag: true
189+
auto_tag_suffix: windows-1809-amd64
190+
daemon_off: true
191+
purge: false
192+
when:
193+
ref:
194+
- refs/heads/master
195+
- refs/tags/**
196+
depends_on:
197+
- testing
198+
trigger:
199+
ref:
200+
- refs/heads/master
201+
- refs/tags/**
202+
- refs/pull/**
203+
204+
---
205+
kind: pipeline
206+
type: vm
207+
name: windows-ltsc2022
208+
platform:
209+
os: windows
210+
arch: amd64
211+
pool:
212+
use: windows-2022
213+
214+
steps:
215+
- name: environment
216+
image: golang:1.19
217+
pull: always
218+
environment:
219+
CGO_ENABLED: "0"
220+
commands:
221+
- go version
222+
- go env
223+
- name: build
224+
image: golang:1.19
225+
environment:
226+
CGO_ENABLED: "0"
227+
commands:
228+
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-github-release.exe ./cmd/drone-github-release
229+
- name: executable
230+
image: golang:1.19
231+
commands:
232+
- ./release/windows/amd64/drone-github-release.exe --help
233+
- name: docker
234+
image: plugins/docker
235+
settings:
236+
dockerfile: docker/Dockerfile.windows.ltsc2022
237+
repo: plugins/github-release
238+
username:
239+
from_secret: docker_username
240+
password:
241+
from_secret: docker_password
242+
auto_tag: true
243+
auto_tag_suffix: windows-ltsc2022-amd64
244+
daemon_off: true
245+
purge: false
246+
when:
247+
ref:
248+
- refs/heads/master
249+
- refs/tags/**
250+
depends_on:
251+
- testing
252+
trigger:
253+
ref:
254+
- refs/heads/master
255+
- refs/tags/**
256+
- refs/pull/**
257+
258+
---
259+
kind: pipeline
260+
type: vm
261+
name: manifest
262+
platform:
263+
os: linux
264+
arch: amd64
265+
pool:
266+
use: ubuntu
267+
268+
steps:
269+
- name: manifest
270+
image: plugins/manifest
271+
settings:
272+
auto_tag: "true"
273+
username:
274+
from_secret: docker_username
275+
password:
276+
from_secret: docker_password
277+
spec: docker/manifest.tmpl
278+
ignore_missing: true
279+
depends_on:
280+
- linux-amd64
281+
- linux-arm64
282+
- windows-1809
283+
- windows-ltsc2022
284+
trigger:
285+
ref:
286+
- refs/heads/master
287+
- refs/tags/**

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/drone-github-release*
33

44
coverage.out
5-
.drone.yml

cmd/drone-github-release/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ package main
1010
import (
1111
"os"
1212

13+
"github.com/drone-plugins/drone-github-release/plugin"
1314
"github.com/drone-plugins/drone-plugin-lib/errors"
1415
"github.com/drone-plugins/drone-plugin-lib/urfave"
1516
"github.com/joho/godotenv"
1617
"github.com/urfave/cli/v2"
17-
"github.com/drone-plugins/drone-github-release/plugin"
1818
)
1919

2020
var version = "unknown"
@@ -23,7 +23,7 @@ func main() {
2323
settings := &plugin.Settings{}
2424

2525
if _, err := os.Stat("/run/drone/env"); err == nil {
26-
godotenv.Overload("/run/drone/env")
26+
_ = godotenv.Overload("/run/drone/env")
2727
}
2828

2929
app := &cli.App{

docker/Dockerfile.linux.arm

Lines changed: 0 additions & 9 deletions
This file was deleted.

docker/Dockerfile.windows.1909

Lines changed: 0 additions & 10 deletions
This file was deleted.

docker/Dockerfile.windows.2004

Lines changed: 0 additions & 10 deletions
This file was deleted.

docker/Dockerfile.windows.1903 renamed to docker/Dockerfile.windows.ltsc2022

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# escape=`
2-
FROM plugins/base:windows-1903-amd64@sha256:338cdba56a7f30d721b6567d382b95465642993f85564cb385e65b2f3f84352c
2+
FROM plugins/base:windows-ltsc2022-amd64@sha256:0f90d5bceb432f1ee6f93cf44eed6a38c322834edd55df8a6648c9e6f15131f4
33

44
LABEL maintainer="Drone.IO Community <[email protected]>" `
55
org.label-schema.name="Drone GitHub Release" `

docker/manifest.tmpl

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,13 @@ manifests:
1717
architecture: arm64
1818
os: linux
1919
variant: v8
20-
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
21-
platform:
22-
architecture: arm
23-
os: linux
24-
variant: v7
25-
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-2004-amd64
26-
platform:
27-
architecture: amd64
28-
os: windows
29-
version: 2004
30-
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1909-amd64
31-
platform:
32-
architecture: amd64
33-
os: windows
34-
version: 1909
35-
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1903-amd64
20+
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
3621
platform:
3722
architecture: amd64
3823
os: windows
39-
version: 1903
40-
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
24+
version: 1809
25+
- image: plugins/github-release:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-ltsc2022-amd64
4126
platform:
4227
architecture: amd64
4328
os: windows
44-
version: 1809
29+
version: ltsc2022

0 commit comments

Comments
 (0)