change .drone.yml to new format (#33)

This commit is contained in:
lunny 2019-07-07 01:40:02 +00:00 committed by Gitea
parent c9d054ae4f
commit 07a623ff83
1 changed files with 177 additions and 120 deletions

View File

@ -1,17 +1,19 @@
---
kind: pipeline
name: default
platform:
os: linux
arch: amd64
workspace:
base: /go
path: src/code.gitea.io/tea
clone:
git:
image: plugins/git:next
depth: 50
tags: true
pipeline:
build:
steps:
- name: build
pull: always
image: golang:1.12
pull: true
environment:
GOPROXY: https://goproxy.cn
commands:
@ -23,115 +25,170 @@ pipeline:
- make test-vendor
- make build
when:
event: [ push, tag, pull_request ]
event:
- push
- tag
- pull_request
unit-test:
- name: unit-test
pull: always
image: golang:1.12
pull: true
group: test
commands:
- make unit-test-coverage
when:
event: [ push, pull_request ]
branch: [ master ]
release-test:
image: golang:1.12
pull: true
settings:
group: test
when:
branch:
- master
event:
- push
- pull_request
- name: release-test
pull: always
image: golang:1.12
commands:
- make test
when:
event: [ push, pull_request ]
branch: [ release/* ]
tag-test:
image: golang:1.12
pull: true
settings:
group: test
when:
branch:
- "release/*"
event:
- push
- pull_request
- name: tag-test
pull: always
image: golang:1.12
commands:
- make test
settings:
group: test
when:
event: [ tag ]
event:
- tag
static:
- name: static
pull: always
image: techknowlogick/xgo:latest
pull: true
commands:
- export PATH=$PATH:$GOPATH/bin
- make release
when:
event: [ push, tag ]
event:
- push
- tag
gpg-sign:
- name: gpg-sign
pull: always
image: plugins/gpgsign:1
pull: true
secrets: [ gpgsign_key, gpgsign_passphrase ]
settings:
detach_sign: true
files:
- dist/release/*
excludes:
- dist/release/*.sha256
when:
event: [ push, tag ]
tag-release:
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: releases
acl: public-read
endpoint: https://storage.gitea.io
path_style: true
strip_prefix: dist/release/
source: dist/release/*
target: /tea/${DRONE_TAG##v}
when:
event: [ tag ]
release-branch-release:
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: releases
acl: public-read
endpoint: https://storage.gitea.io
path_style: true
strip_prefix: dist/release/
source: dist/release/*
target: /tea/${DRONE_BRANCH##release/v}
when:
event: [ push ]
branch: [ release/* ]
release:
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: releases
acl: public-read
endpoint: https://storage.gitea.io
path_style: true
strip_prefix: dist/release/
source: dist/release/*
target: /tea/master
when:
event: [ push ]
branch: [ master ]
github:
image: plugins/github-release:1
pull: true
secrets: [ github_token ]
- "dist/release/*.sha256"
files:
- dist/release/*
- "dist/release/*"
environment:
GPGSIGN_KEY:
from_secret: gpgsign_key
GPGSIGN_PASSPHRASE:
from_secret: gpgsign_passphrase
when:
event: [ tag ]
event:
- push
- tag
discord:
image: appleboy/drone-discord:1.0.0
pull: true
secrets: [ discord_webhook_id, discord_webhook_token ]
- name: tag-release
pull: always
image: plugins/s3:1
settings:
acl: public-read
bucket: releases
endpoint: https://storage.gitea.io
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
target: "/tea/${DRONE_TAG##v}"
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
when:
event: [ push, tag, pull_request ]
status: [ changed, failure ]
event:
- tag
- name: release-branch-release
pull: always
image: plugins/s3:1
settings:
acl: public-read
bucket: releases
endpoint: https://storage.gitea.io
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
target: "/tea/${DRONE_BRANCH##release/v}"
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
when:
branch:
- "release/*"
event:
- push
- name: release
pull: always
image: plugins/s3:1
settings:
acl: public-read
bucket: releases
endpoint: https://storage.gitea.io
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
target: /tea/master
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
when:
branch:
- master
event:
- push
- name: github
pull: always
image: plugins/gitea-releases:1
settings:
files:
- "dist/release/*"
environment:
GITHUB_TOKEN:
from_secret: github_token
when:
event:
- tag
- name: discord
pull: always
image: appleboy/drone-discord:1.0.0
environment:
DISCORD_WEBHOOK_ID:
from_secret: discord_webhook_id
DISCORD_WEBHOOK_TOKEN:
from_secret: discord_webhook_token
when:
event:
- push
- tag
- pull_request
status:
- changed
- failure