Skip to content

Commit 80da996

Browse files
committed
add drone config to create artifact for release
1 parent ee4bf23 commit 80da996

File tree

1 file changed

+50
-5
lines changed

1 file changed

+50
-5
lines changed

.drone.star

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
OC_CI_NODEJS = "owncloudci/nodejs:18"
1+
OC_CI_ALPINE = "owncloudci/alpine:latest"
22
OC_CI_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
3-
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:5.0"
3+
OC_CI_NODEJS = "owncloudci/nodejs:18"
44
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
55
OCIS_IMAGE = "owncloud/ocis:5.0"
6+
PLUGINS_GITHUB_RELEASE = "plugins/github-release:1"
7+
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:5.0"
68

79
dir = {
810
"webConfig": "/drone/src/tests/drone/web.config.json",
@@ -12,7 +14,8 @@ def main(ctx):
1214
return checkStarlark() + \
1315
pnpmlint(ctx) + \
1416
unitTestPipeline(ctx) + \
15-
e2eTests()
17+
e2eTests() + \
18+
releaseArtifacts(ctx)
1619

1720
def checkStarlark():
1821
return [{
@@ -137,9 +140,8 @@ def serveExtension():
137140
{
138141
"name": "extension",
139142
"image": OC_CI_NODEJS,
140-
"detach": True,
141143
"commands": [
142-
"pnpm build:w",
144+
"pnpm build",
143145
],
144146
},
145147
]
@@ -221,3 +223,46 @@ def ocisService():
221223
],
222224
},
223225
]
226+
227+
def releaseArtifacts(ctx):
228+
version = ctx.build.ref.replace("refs/tags/", "")
229+
return [{
230+
"kind": "pipeline",
231+
"type": "docker",
232+
"name": "publish-artifacts",
233+
"steps": installPnpm() +
234+
serveExtension() +
235+
[
236+
{
237+
"name": "zip-artifacts",
238+
"image": OC_CI_ALPINE,
239+
"commands": [
240+
"apk add --no-cache zip",
241+
"mv dist dicom-viewer",
242+
"zip -r dicom-viewer-%s.zip dicom-viewer" % version,
243+
],
244+
},
245+
{
246+
"name": "publish",
247+
"image": PLUGINS_GITHUB_RELEASE,
248+
"settings": {
249+
"overwrite": True,
250+
"files": [
251+
"dicom-viewer-%s.zip" % version,
252+
],
253+
"checksum": [
254+
"md5",
255+
"sha256",
256+
],
257+
"api_key": {
258+
"from_secret": "github_token",
259+
},
260+
},
261+
},
262+
],
263+
"trigger": {
264+
"ref": [
265+
"refs/tags/**",
266+
],
267+
},
268+
}]

0 commit comments

Comments
 (0)