@@ -3,6 +3,8 @@ OC_CI_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
3
3
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:5.0"
4
4
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
5
5
OCIS_IMAGE = "owncloud/ocis:5.0"
6
+ PLUGINS_GITHUB_RELEASE = "plugins/github-release"
7
+ OC_CI_ALPINE = "owncloudci/alpine:latest"
6
8
7
9
dir = {
8
10
"webConfig" : "/drone/src/tests/drone/web.config.json" ,
@@ -12,7 +14,8 @@ def main(ctx):
12
14
return checkStarlark () + \
13
15
pnpmlint (ctx ) + \
14
16
unitTestPipeline (ctx ) + \
15
- e2eTests ()
17
+ e2eTests () + \
18
+ releaseArtifacts ()
16
19
17
20
def checkStarlark ():
18
21
return [{
@@ -221,3 +224,51 @@ def ocisService():
221
224
],
222
225
},
223
226
]
227
+
228
+ def releaseArtifacts ():
229
+ return [{
230
+ "kind" : "pipeline" ,
231
+ "type" : "docker" ,
232
+ "name" : "create-artifacts" ,
233
+ "steps" : installPnpm () + \
234
+ serveExtension () + \
235
+ [
236
+ {
237
+ "name" : "check-dist" ,
238
+ "image" : OC_CI_ALPINE ,
239
+ "commands" : [
240
+ "ls -la dist" ,
241
+ ],
242
+ },
243
+ {
244
+ "name" : "zip-artifacts" ,
245
+ "image" : OC_CI_ALPINE ,
246
+ "commands" : [
247
+ "if [ -d 'dist' ] && [ \" $(ls -A dist)\" ]; then cd dist && zip -r ../dicomviewer-viewer-${DRONE_TAG}.zip .; else echo 'Dist folder is empty or does not exist'; exit 1; fi" ,
248
+ "md5sum dicomviewer-${DRONE_TAG}.zip > md5sum.txt" ,
249
+ "sha256sum dicomviewer-${DRONE_TAG}.zip > sha256sum.txt" ,
250
+ ],
251
+ },
252
+ {
253
+ "name" : "publish" ,
254
+ "image" : PLUGINS_GITHUB_RELEASE ,
255
+ "settings" : {
256
+ "api_key" : {
257
+ "from_secret" : "GITHUB_TOKEN" ,
258
+ },
259
+ "files" : [
260
+ "dicomviewer-${DRONE_TAG}.zip" ,
261
+ "md5sum.txt" ,
262
+ "sha256sum.txt" ,
263
+ ],
264
+ "overwrite" : True ,
265
+ },
266
+ },
267
+ ],
268
+ "trigger" : {
269
+ "ref" : [
270
+ "refs/tags/**" ,
271
+ "refs/pull/**" , # remove this
272
+ ],
273
+ },
274
+ }]
0 commit comments