From c3a6c03752fd09de87ee4ef98acaffcfd337ad04 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 4 Jan 2021 16:02:52 +0100 Subject: [PATCH] build: add github releases --- .drone.jsonnet | 40 ++++++++++++++++++++++++++++++++++++++++ .drone.yml | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 026f162..b112738 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -27,6 +27,45 @@ local PipelineTest = { }, }; +local PipelineBuildPackage = { + kind: 'pipeline', + image_pull_secrets: ['docker_config'], + name: 'build-package', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'checksum', + image: 'alpine', + commands: [ + 'sha256sum wait-for > sha256sum.txt', + ], + }, + { + name: 'publish-github', + image: 'plugins/github-release', + settings: { + overwrite: true, + api_key: { from_secret: 'github_token' }, + files: ['wait-for', 'sha256sum.txt'], + title: '${DRONE_TAG}', + note: 'CHANGELOG.md', + }, + when: { + ref: ['refs/tags/**'], + }, + }, + ], + depends_on: [ + 'test', + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, +}; + local PipelineBuildContainer(arch='amd64') = { kind: 'pipeline', image_pull_secrets: ['docker_config'], @@ -192,6 +231,7 @@ local PipelineNotifications = { [ PipelineTest, + PipelineBuildPackage, PipelineBuildContainer(arch='amd64'), PipelineBuildContainer(arch='arm64'), PipelineBuildContainer(arch='arm'), diff --git a/.drone.yml b/.drone.yml index a9f6b89..516c7ef 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,6 +26,47 @@ trigger: - refs/tags/** - refs/pull/** +--- +kind: pipeline +name: build-package + +platform: + os: linux + arch: amd64 + +steps: +- name: checksum + image: alpine + commands: + - sha256sum wait-for > sha256sum.txt + +- name: publish-github + image: plugins/github-release + settings: + api_key: + from_secret: github_token + files: + - wait-for + - sha256sum.txt + note: CHANGELOG.md + overwrite: true + title: ${DRONE_TAG} + when: + ref: + - refs/tags/** + +image_pull_secrets: +- docker_config + +trigger: + ref: + - refs/heads/master + - refs/tags/** + - refs/pull/** + +depends_on: +- test + --- kind: pipeline name: build-container-amd64 @@ -347,6 +388,6 @@ depends_on: --- kind: signature -hmac: 22c03cba1bdc4e88f031f2f0cc8b6bcc6c366a03c855318299a6c18805260d2e +hmac: cd3964127ba23a4f794b0ed48cbe2cef784c69e01837bccfaad4337a78f03664 ...