feat: add deploy binary

This commit is contained in:
Bo-Yi Wu 2019-02-17 10:33:38 +08:00
parent d6b125708f
commit d066ff420e
2 changed files with 87 additions and 0 deletions

View File

@ -193,6 +193,51 @@ local PipelineBuild(name, os='linux', arch='amd64') = {
},
};
local PipelineRelease = {
kind: 'pipeline',
name: 'release-binary',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'build-all-binary',
image: 'golang:1.11',
pull: 'always',
environment: {
GO111MODULE: 'on',
},
commands: [
'make release'
],
when: {
event: [ 'tag' ],
},
},
{
name: 'deploy-all-binary',
image: 'plugins/github-release',
pull: 'always',
settings: {
files: [ 'dist/release/*' ],
api_key: { 'from_secret': 'github_release_api_key' },
},
when: {
event: [ 'tag' ],
},
},
],
depends_on: [
'testing',
],
trigger: {
ref: [
'refs/tags/**',
],
},
};
local PipelineNotifications(os='linux', arch='amd64', depends_on=[]) = {
kind: 'pipeline',
name: 'notifications',
@ -225,9 +270,11 @@ local PipelineNotifications(os='linux', arch='amd64', depends_on=[]) = {
PipelineBuild(name, 'linux', 'amd64'),
PipelineBuild(name, 'linux', 'arm64'),
PipelineBuild(name, 'linux', 'arm'),
PipelineRelease,
PipelineNotifications(depends_on=[
'linux-amd64',
'linux-arm64',
'linux-arm',
'release-binary',
]),
]

View File

@ -316,6 +316,45 @@ trigger:
depends_on:
- testing
---
kind: pipeline
name: release-binary
platform:
os: linux
arch: amd64
steps:
- name: build-all-binary
pull: always
image: golang:1.11
commands:
- make release
environment:
GO111MODULE: on
when:
event:
- tag
- name: deploy-all-binary
pull: always
image: plugins/github-release
settings:
api_key:
from_secret: github_release_api_key
files:
- "dist/release/*"
when:
event:
- tag
trigger:
ref:
- "refs/tags/**"
depends_on:
- testing
---
kind: pipeline
name: notifications
@ -346,5 +385,6 @@ depends_on:
- linux-amd64
- linux-arm64
- linux-arm
- release-binary
...