build: add github releases

This commit is contained in:
Robert Kaussow 2021-01-04 16:02:52 +01:00
parent 6e25a245d7
commit c3a6c03752
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
2 changed files with 82 additions and 1 deletions

View File

@ -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') = { local PipelineBuildContainer(arch='amd64') = {
kind: 'pipeline', kind: 'pipeline',
image_pull_secrets: ['docker_config'], image_pull_secrets: ['docker_config'],
@ -192,6 +231,7 @@ local PipelineNotifications = {
[ [
PipelineTest, PipelineTest,
PipelineBuildPackage,
PipelineBuildContainer(arch='amd64'), PipelineBuildContainer(arch='amd64'),
PipelineBuildContainer(arch='arm64'), PipelineBuildContainer(arch='arm64'),
PipelineBuildContainer(arch='arm'), PipelineBuildContainer(arch='arm'),

View File

@ -26,6 +26,47 @@ trigger:
- refs/tags/** - refs/tags/**
- refs/pull/** - 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 kind: pipeline
name: build-container-amd64 name: build-container-amd64
@ -347,6 +388,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: 22c03cba1bdc4e88f031f2f0cc8b6bcc6c366a03c855318299a6c18805260d2e hmac: cd3964127ba23a4f794b0ed48cbe2cef784c69e01837bccfaad4337a78f03664
... ...