-
Notifications
You must be signed in to change notification settings - Fork 7
/
.drone.yml
117 lines (108 loc) · 5.53 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
kind: pipeline
name: kobopatch
steps:
- name: test
image: golang:1.13-buster
commands:
- go test -cover -v ./...
---
kind: pipeline
name: test-patches
steps:
- name: build
image: golang:1.13-buster
commands:
- mkdir build
- CGO_ENABLED=1 go build -o build/kobopatch ./kobopatch
- name: get-patches
image: golang:1.13-buster
commands:
- git clone https://github.com/pgaskin/kobopatch-patches
- cd kobopatch-patches
- git checkout "$(git describe --tags --abbrev=0 HEAD)"
- go build -o ./scripts/testscript ./scripts/test
- name: test
image: golang:1.13-buster
commands:
- cd kobopatch-patches
- ./scripts/testscript --kpbin ../build/kobopatch
---
kind: pipeline
name: release
platform:
os: linux
arch: amd64
steps:
- name: notes
image: golang:1.13-buster
commands:
- git fetch --tags
- git log "$(git describe --tags --abbrev=0 HEAD~1)..HEAD" --oneline --format='%h %s' | tee -a notes.md
- name: build-linux-amd64
image: docker.elastic.co/beats-dev/golang-crossbuild:1.13.6-main
command: [
"--platforms", "linux/amd64",
"--build-cmd", "
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-linux-64bit ./kobopatch &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-apply-linux-64bit ./tools/kobopatch-apply &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/cssextract-linux-64bit ./tools/cssextract &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/symdump-linux-64bit ./tools/symdump",
]
- name: build-linux-386
image: docker.elastic.co/beats-dev/golang-crossbuild:1.13.6-main
command: [
"--platforms", "linux/amd64",
"--build-cmd", "
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-linux-32bit ./kobopatch &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-apply-linux-32bit ./tools/kobopatch-apply &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/cssextract-linux-32bit ./tools/cssextract &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/symdump-linux-32bit ./tools/symdump",
]
- name: build-linux-arm
image: docker.elastic.co/beats-dev/golang-crossbuild:1.13.6-arm
command: [
"--platforms", "linux/armv6",
"--build-cmd", "
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-linux-arm ./kobopatch &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-apply-linux-arm ./tools/kobopatch-apply &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/cssextract-linux-arm ./tools/cssextract &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/symdump-linux-arm ./tools/symdump",
]
- name: build-windows-386
image: docker.elastic.co/beats-dev/golang-crossbuild:1.13.6-main
command: [
"--platforms", "windows/386",
"--build-cmd", "
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always) -extldflags -static\" -o build/koboptch-windows.exe ./kobopatch &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always) -extldflags -static\" -o build/koboptch-apply-windows.exe ./tools/kobopatch-apply &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always) -extldflags -static\" -o build/cssextract-windows.exe ./tools/cssextract &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always) -extldflags -static\" -o build/symdump-windows.exe ./tools/symdump",
]
- name: build-darwin-amd64
image: docker.elastic.co/beats-dev/golang-crossbuild:1.13.6-darwin
command: [
"--platforms", "darwin/amd64",
"--build-cmd", "
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-darwin-64bit ./kobopatch &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/kobopatch-apply-darwin-64bit ./tools/kobopatch-apply &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/cssextract-darwin-64bit ./tools/cssextract &&
CGO_ENABLED=1 go build -ldflags \"-s -w -linkmode external -X main.version=$(git describe --tags --always)\" -o build/symdump-darwin-64bit ./tools/symdump",
]
- name: list
image: golang:1.13-buster
commands:
- ls -lah build
depends_on: [build-linux-amd64, build-linux-arm, build-linux-386, build-windows-386, build-darwin-amd64]
- name: release
image: plugins/github-release
settings:
api_key: {from_secret: GITHUB_TOKEN}
title: ${DRONE_TAG}
note: notes.md
files: build/*
draft: true
when: {ref: {include: ["refs/tags/*"]}}
depends_on: [notes, list]
depends_on:
- kobopatch
- test-patches