1
1
kind : pipeline
2
2
type : vm
3
3
name : default
4
+ platform :
5
+ os : linux
6
+ arch : amd64
7
+ pool :
8
+ use : ubuntu
9
+
10
+ steps :
11
+ - name : build
12
+ image : golang:1.19
13
+ commands :
14
+ - go test ./...
15
+ - sh scripts/build.sh
16
+ trigger :
17
+ ref :
18
+ - refs/heads/main
19
+ - refs/tags/**
20
+ - refs/pull/**
21
+
22
+ ---
23
+ kind : pipeline
24
+ type : vm
25
+ name : linux-amd64
26
+ platform :
27
+ os : linux
28
+ arch : amd64
29
+ pool :
30
+ use : ubuntu
31
+
32
+ steps :
33
+ - name : environment
34
+ image : golang:1.22
35
+ pull : always
36
+ environment :
37
+ CGO_ENABLED : " 0"
38
+ commands :
39
+ - go version
40
+ - go env
41
+ - name : build
42
+ image : golang:1.22
43
+ environment :
44
+ CGO_ENABLED : " 0"
45
+ commands :
46
+ - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/plugin .
47
+ - name : docker
48
+ image : plugins/docker
49
+ settings :
50
+ dockerfile : docker/Dockerfile
51
+ repo : plugins/artifact-metadata-publisher
52
+ username :
53
+ from_secret : docker_username
54
+ password :
55
+ from_secret : docker_password
56
+ auto_tag : true
57
+ auto_tag_suffix : linux-amd64
58
+ depends_on :
59
+ - default
60
+ trigger :
61
+ ref :
62
+ - refs/heads/main
63
+ - refs/tags/**
64
+ - refs/pull/**
65
+
66
+ ---
67
+ kind : pipeline
68
+ type : vm
69
+ name : linux-arm64
70
+ platform :
71
+ os : linux
72
+ arch : arm64
73
+ pool :
74
+ use : ubuntu_arm64
4
75
76
+ steps :
77
+ - name : environment
78
+ image : golang:1.22
79
+ pull : always
80
+ environment :
81
+ CGO_ENABLED : " 0"
82
+ commands :
83
+ - go version
84
+ - go env
85
+ - name : build
86
+ image : golang:1.22
87
+ environment :
88
+ CGO_ENABLED : " 0"
89
+ commands :
90
+ - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/plugin .
91
+ - name : docker
92
+ image : plugins/docker
93
+ settings :
94
+ dockerfile : docker/Dockerfile.linux.arm64
95
+ repo : plugins/artifact-metadata-publisher
96
+ username :
97
+ from_secret : docker_username
98
+ password :
99
+ from_secret : docker_password
100
+ auto_tag : true
101
+ auto_tag_suffix : linux-arm64
102
+ depends_on :
103
+ - default
104
+ trigger :
105
+ ref :
106
+ - refs/heads/main
107
+ - refs/tags/**
108
+ - refs/pull/**
109
+
110
+ ---
111
+ kind : pipeline
112
+ type : vm
113
+ name : windows-ltsc2022
114
+ platform :
115
+ os : windows
116
+ arch : amd64
117
+ pool :
118
+ use : windows-2022
119
+
120
+ steps :
121
+ - name : environment
122
+ image : golang:1.22
123
+ pull : always
124
+ environment :
125
+ CGO_ENABLED : " 0"
126
+ commands :
127
+ - go version
128
+ - go env
129
+ - name : build
130
+ image : golang:1.22
131
+ environment :
132
+ CGO_ENABLED : " 0"
133
+ commands :
134
+ - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/plugin.exe .
135
+ - name : docker
136
+ image : plugins/docker
137
+ settings :
138
+ dockerfile : docker/Dockerfile.windows
139
+ repo : plugins/artifact-metadata-publisher
140
+ username :
141
+ from_secret : docker_username
142
+ password :
143
+ from_secret : docker_password
144
+ auto_tag : true
145
+ auto_tag_suffix : windows-ltsc2022-amd64
146
+ daemon_off : true
147
+ purge : false
148
+ when :
149
+ ref :
150
+ - refs/heads/main
151
+ - refs/tags/**
152
+ depends_on :
153
+ - default
154
+ trigger :
155
+ ref :
156
+ - refs/heads/main
157
+ - refs/tags/**
158
+ - refs/pull/**
159
+
160
+ ---
161
+ kind : pipeline
162
+ type : vm
163
+ name : manifest
5
164
platform :
6
165
os : linux
7
166
arch : amd64
8
167
pool :
9
168
use : ubuntu
10
169
11
170
steps :
12
- - name : build
13
- image : golang:1.19
14
- commands :
15
- - go test ./...
16
- - sh scripts/build.sh
17
-
18
- - name : publish
19
- image : plugins/docker
20
- pull : if-not-exists
21
- settings :
22
- repo : plugins/artifact-metadata-publisher
23
- auto_tag : true
24
- dockerfile : Dockerfile
25
- username :
26
- from_secret : docker_username
27
- password :
28
- from_secret : docker_password
29
- when :
30
- event :
31
- exclude :
32
- - pull_request
171
+ - name : manifest
172
+ image : plugins/manifest
173
+ settings :
174
+ auto_tag : " true"
175
+ username :
176
+ from_secret : docker_username
177
+ password :
178
+ from_secret : docker_password
179
+ spec : docker/manifest.tmpl
180
+ ignore_missing : true
181
+ depends_on :
182
+ - linux-amd64
183
+ - linux-arm64
184
+ - windows-ltsc2022
185
+ trigger :
186
+ ref :
187
+ - refs/heads/main
188
+ - refs/tags/**
189
+
190
+ ---
191
+ kind : pipeline
192
+ name : binaries
193
+ type : vm
194
+
195
+ pool :
196
+ use : ubuntu
197
+
198
+ steps :
199
+ - name : build
200
+ pull : always
201
+ image : golang:1.22
202
+ commands :
203
+ - GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -a -tags netgo -o release/artifact-metadata-publisher-linux-amd64
204
+ - GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -a -tags netgo -o release/artifact-metadata-publisher-linux-arm64
205
+ - GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -a -tags netgo -o release/artifact-metadata-publisher-darwin-amd64
206
+ - GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -a -tags netgo -o release/artifact-metadata-publisher-darwin-arm64
207
+ - GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -a -tags netgo -o release/artifact-metadata-publisher-windows-amd64
208
+
209
+ environment :
210
+ CGO_ENABLED : 0
211
+ GO111MODULE : on
212
+
213
+ - name : zstd-compress
214
+ commands :
215
+ - sudo apt-get update -y
216
+ - sudo apt-get install -y zstd
217
+ - zstd release/artifact-metadata-publisher-linux-amd64
218
+ - zstd release/artifact-metadata-publisher-linux-arm64
219
+ - zstd release/artifact-metadata-publisher-darwin-arm64
220
+ - zstd release/artifact-metadata-publisher-darwin-amd64
221
+ - zstd release/artifact-metadata-publisher-windows-amd64
222
+
223
+ - name : release
224
+ image : plugins/github-release
225
+ settings :
226
+ files :
227
+ - release/artifact-metadata-publisher-linux-amd64.zst
228
+ - release/artifact-metadata-publisher-linux-arm64.zst
229
+ - release/artifact-metadata-publisher-darwin-arm64.zst
230
+ - release/artifact-metadata-publisher-darwin-amd64.zst
231
+ - release/artifact-metadata-publisher-windows-amd64.zst
232
+ api_key :
233
+ from_secret : github_token
234
+ when :
235
+ event :
236
+ - tag
237
+ depends_on :
238
+ - linux-amd64
239
+ - linux-arm64
240
+ - windows-ltsc2022
241
+ trigger :
242
+ ref :
243
+ - refs/heads/main
244
+ - refs/tags/**
0 commit comments