diff --git a/.drone.star b/.drone.star index d9c66928..549f674c 100644 --- a/.drone.star +++ b/.drone.star @@ -1,9 +1,11 @@ -OC_CI_NODEJS = "owncloudci/nodejs:18" +OC_CI_ALPINE = "owncloudci/alpine:latest" OC_CI_BUILDIFIER = "owncloudci/bazel-buildifier:latest" -SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:11.0" +OC_CI_NODEJS = "owncloudci/nodejs:18" OC_CI_WAIT_FOR = "owncloudci/wait-for:latest" OCIS_IMAGE = "owncloud/ocis:5.0" PLUGINS_DOCKER = "plugins/docker:latest" +PLUGINS_GITHUB_RELEASE = "plugins/github-release:1" +SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:11.0" dir = { "webConfig": "/drone/src/tests/drone/web.config.json", @@ -14,7 +16,8 @@ def main(ctx): pnpmlint(ctx) + \ unitTestPipeline(ctx) + \ e2eTests() + \ - dockerRelease(ctx) + dockerRelease(ctx) + \ + releaseArtifacts(ctx) def checkStarlark(): return [{ @@ -142,6 +145,8 @@ def serveExtension(): "detach": True, "commands": [ "pnpm build:w", + "pwd", + "ls -al", ], }, ] @@ -256,12 +261,12 @@ def dockerRelease(ctx): "name": "docker", "image": PLUGINS_DOCKER, "settings": { - "username": { - "from_secret": "docker_username", - }, - "password": { - "from_secret": "docker_password", - }, + # "username": { + # "from_secret": "docker_username", + # }, + # "password": { + # "from_secret": "docker_password", + # }, "tags": tag, "dockerfile": "Dockerfile", "repo": repo, @@ -284,3 +289,48 @@ def dockerRelease(ctx): }, }, ] + +def releaseArtifacts(ctx): + version = ctx.build.ref.replace("refs/tags/", "") + return [{ + "kind": "pipeline", + "type": "docker", + "name": "publish-artifacts", + "steps": installPnpm() + + serveExtension() + + [ + { + "name": "zip-artifacts", + "image": OC_CI_ALPINE, + "commands": [ + "pwd", + "apk add --no-cache zip", + "mv dist dicom-viewer", + "zip -r dicom-viewer-%s.zip dicom-viewer" % version, + ], + }, + { + "name": "publish", + "image": PLUGINS_GITHUB_RELEASE, + "settings": { + "title": version, + "overwrite": True, + "files": [ + "dicom-viewer-%s.zip" % version, + ], + "checksum": [ + "md5", + "sha256", + ], + "api_key": { + "from_secret": "github_token", + }, + }, + }, + ], + "trigger": { + "ref": [ + "refs/tags/**", + ], + }, + }]