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: workspace:
base: /go base: /go
path: src/code.gitea.io/tea path: src/code.gitea.io/tea
clone: steps:
git: - name: build
image: plugins/git:next pull: always
depth: 50
tags: true
pipeline:
build:
image: golang:1.12 image: golang:1.12
pull: true
environment: environment:
GOPROXY: https://goproxy.cn GOPROXY: https://goproxy.cn
commands: commands:
@ -23,115 +25,170 @@ pipeline:
- make test-vendor - make test-vendor
- make build - make build
when: when:
event: [ push, tag, pull_request ] event:
- push
- tag
- pull_request
unit-test: - name: unit-test
pull: always
image: golang:1.12 image: golang:1.12
pull: true
group: test
commands: commands:
- make unit-test-coverage - make unit-test-coverage
when: settings:
event: [ push, pull_request ]
branch: [ master ]
release-test:
image: golang:1.12
pull: true
group: test group: test
when:
branch:
- master
event:
- push
- pull_request
- name: release-test
pull: always
image: golang:1.12
commands: commands:
- make test - make test
when: settings:
event: [ push, pull_request ]
branch: [ release/* ]
tag-test:
image: golang:1.12
pull: true
group: test group: test
when:
branch:
- "release/*"
event:
- push
- pull_request
- name: tag-test
pull: always
image: golang:1.12
commands: commands:
- make test - make test
settings:
group: test
when: when:
event: [ tag ] event:
- tag
static: - name: static
pull: always
image: techknowlogick/xgo:latest image: techknowlogick/xgo:latest
pull: true
commands: commands:
- export PATH=$PATH:$GOPATH/bin - export PATH=$PATH:$GOPATH/bin
- make release - make release
when: when:
event: [ push, tag ] event:
- push
- tag
gpg-sign: - name: gpg-sign
pull: always
image: plugins/gpgsign:1 image: plugins/gpgsign:1
pull: true settings:
secrets: [ gpgsign_key, gpgsign_passphrase ]
detach_sign: true detach_sign: true
files:
- dist/release/*
excludes: excludes:
- dist/release/*.sha256 - "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 ]
files: files:
- dist/release/* - "dist/release/*"
environment:
GPGSIGN_KEY:
from_secret: gpgsign_key
GPGSIGN_PASSPHRASE:
from_secret: gpgsign_passphrase
when: when:
event: [ tag ] event:
- push
- tag
discord: - name: tag-release
image: appleboy/drone-discord:1.0.0 pull: always
pull: true image: plugins/s3:1
secrets: [ discord_webhook_id, discord_webhook_token ] 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: when:
event: [ push, tag, pull_request ] event:
status: [ changed, failure ] - 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