2019-07-06 21:40:02 -04:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
2019-04-25 13:06:53 -04:00
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/code.gitea.io/tea
|
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
pull: always
|
2019-10-28 17:10:20 -04:00
|
|
|
image: golang:1.13
|
2019-07-06 21:40:02 -04:00
|
|
|
environment:
|
2019-06-04 21:34:21 -04:00
|
|
|
GOPROXY: https://goproxy.cn
|
2019-07-06 21:40:02 -04:00
|
|
|
commands:
|
|
|
|
- make clean
|
|
|
|
- make vet
|
|
|
|
- make lint
|
|
|
|
- make fmt-check
|
|
|
|
- make misspell-check
|
|
|
|
- make test-vendor
|
|
|
|
- make build
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
|
|
|
- pull_request
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: unit-test
|
|
|
|
pull: always
|
2019-10-28 17:10:20 -04:00
|
|
|
image: golang:1.13
|
2019-07-06 21:40:02 -04:00
|
|
|
commands:
|
|
|
|
- make unit-test-coverage
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
group: test
|
2019-07-06 21:40:02 -04:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: release-test
|
|
|
|
pull: always
|
2019-10-28 17:10:20 -04:00
|
|
|
image: golang:1.13
|
2019-07-06 21:40:02 -04:00
|
|
|
commands:
|
|
|
|
- make test
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
group: test
|
2019-07-06 21:40:02 -04:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- "release/*"
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: tag-test
|
|
|
|
pull: always
|
2019-10-28 17:10:20 -04:00
|
|
|
image: golang:1.13
|
2019-07-06 21:40:02 -04:00
|
|
|
commands:
|
|
|
|
- make test
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
group: test
|
2019-07-06 21:40:02 -04:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: static
|
|
|
|
pull: always
|
|
|
|
image: techknowlogick/xgo:latest
|
|
|
|
commands:
|
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
|
|
- make release
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: gpg-sign
|
|
|
|
pull: always
|
|
|
|
image: plugins/gpgsign:1
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
detach_sign: true
|
|
|
|
excludes:
|
2019-07-06 21:40:02 -04:00
|
|
|
- "dist/release/*.sha256"
|
|
|
|
files:
|
|
|
|
- "dist/release/*"
|
|
|
|
environment:
|
|
|
|
GPGSIGN_KEY:
|
|
|
|
from_secret: gpgsign_key
|
|
|
|
GPGSIGN_PASSPHRASE:
|
|
|
|
from_secret: gpgsign_passphrase
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: tag-release
|
|
|
|
pull: always
|
|
|
|
image: plugins/s3:1
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
acl: public-read
|
2019-07-06 21:40:02 -04:00
|
|
|
bucket: releases
|
2019-04-25 13:06:53 -04:00
|
|
|
endpoint: https://storage.gitea.io
|
|
|
|
path_style: true
|
2019-07-06 21:40:02 -04:00
|
|
|
source: "dist/release/*"
|
2019-04-25 13:06:53 -04:00
|
|
|
strip_prefix: dist/release/
|
2019-07-06 21:40:02 -04:00
|
|
|
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:
|
|
|
|
- tag
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: release-branch-release
|
|
|
|
pull: always
|
|
|
|
image: plugins/s3:1
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
acl: public-read
|
2019-07-06 21:40:02 -04:00
|
|
|
bucket: releases
|
2019-04-25 13:06:53 -04:00
|
|
|
endpoint: https://storage.gitea.io
|
|
|
|
path_style: true
|
2019-07-06 21:40:02 -04:00
|
|
|
source: "dist/release/*"
|
2019-04-25 13:06:53 -04:00
|
|
|
strip_prefix: dist/release/
|
2019-07-06 21:40:02 -04:00
|
|
|
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
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: release
|
|
|
|
pull: always
|
|
|
|
image: plugins/s3:1
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
acl: public-read
|
2019-07-06 21:40:02 -04:00
|
|
|
bucket: releases
|
2019-04-25 13:06:53 -04:00
|
|
|
endpoint: https://storage.gitea.io
|
|
|
|
path_style: true
|
2019-07-06 21:40:02 -04:00
|
|
|
source: "dist/release/*"
|
2019-04-25 13:06:53 -04:00
|
|
|
strip_prefix: dist/release/
|
|
|
|
target: /tea/master
|
2019-07-06 21:40:02 -04:00
|
|
|
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
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- name: github
|
|
|
|
pull: always
|
|
|
|
image: plugins/gitea-releases:1
|
|
|
|
settings:
|
2019-04-25 13:06:53 -04:00
|
|
|
files:
|
2019-07-06 21:40:02 -04:00
|
|
|
- "dist/release/*"
|
|
|
|
environment:
|
|
|
|
GITHUB_TOKEN:
|
|
|
|
from_secret: github_token
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2019-04-25 13:06:53 -04:00
|
|
|
|
2019-07-06 21:40:02 -04:00
|
|
|
- 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
|
2019-10-28 17:10:20 -04:00
|
|
|
- failure
|