2019-07-07 09:40:02 +08:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
2022-03-29 07:11:11 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: build
|
|
|
|
pull: always
|
2023-02-08 05:46:31 +08:00
|
|
|
image: golang:1.20
|
2019-07-07 09:40:02 +08:00
|
|
|
environment:
|
2022-03-29 05:59:48 +08:00
|
|
|
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
|
2019-07-07 09:40:02 +08:00
|
|
|
commands:
|
|
|
|
- make clean
|
|
|
|
- make vet
|
|
|
|
- make lint
|
|
|
|
- make fmt-check
|
|
|
|
- make misspell-check
|
|
|
|
- make build
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
|
|
|
- pull_request
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: unit-test
|
2023-02-08 05:46:31 +08:00
|
|
|
image: golang:1.20
|
2019-07-07 09:40:02 +08:00
|
|
|
commands:
|
|
|
|
- make unit-test-coverage
|
|
|
|
settings:
|
2019-04-26 01:06:53 +08:00
|
|
|
group: test
|
2022-03-29 05:59:48 +08:00
|
|
|
environment:
|
|
|
|
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
|
2019-07-07 09:40:02 +08:00
|
|
|
when:
|
|
|
|
branch:
|
2022-08-26 23:34:40 +08:00
|
|
|
- main
|
2019-07-07 09:40:02 +08:00
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: release-test
|
2023-02-08 05:46:31 +08:00
|
|
|
image: golang:1.20
|
2019-07-07 09:40:02 +08:00
|
|
|
commands:
|
|
|
|
- make test
|
|
|
|
settings:
|
2019-04-26 01:06:53 +08:00
|
|
|
group: test
|
2022-03-29 05:59:48 +08:00
|
|
|
environment:
|
|
|
|
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
|
2019-07-07 09:40:02 +08:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- "release/*"
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: tag-test
|
|
|
|
pull: always
|
2023-02-08 05:46:31 +08:00
|
|
|
image: golang:1.20
|
2019-07-07 09:40:02 +08:00
|
|
|
commands:
|
|
|
|
- make test
|
|
|
|
settings:
|
2019-04-26 01:06:53 +08:00
|
|
|
group: test
|
2022-03-29 05:59:48 +08:00
|
|
|
environment:
|
|
|
|
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
|
2019-07-07 09:40:02 +08:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: static
|
2023-02-08 05:46:31 +08:00
|
|
|
image: golang:1.20
|
2020-03-08 09:29:46 +08:00
|
|
|
environment:
|
2022-03-29 05:59:48 +08:00
|
|
|
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
|
2019-07-07 09:40:02 +08:00
|
|
|
commands:
|
|
|
|
- make release
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: gpg-sign
|
|
|
|
pull: always
|
|
|
|
image: plugins/gpgsign:1
|
|
|
|
settings:
|
2019-04-26 01:06:53 +08:00
|
|
|
detach_sign: true
|
|
|
|
excludes:
|
2019-07-07 09:40:02 +08: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-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: tag-release
|
|
|
|
pull: always
|
2021-10-10 20:48:51 +08:00
|
|
|
image: woodpeckerci/plugin-s3:latest
|
2019-07-07 09:40:02 +08:00
|
|
|
settings:
|
2023-02-08 05:53:05 +08:00
|
|
|
acl:
|
|
|
|
from_secret: aws_s3_acl
|
|
|
|
region:
|
|
|
|
from_secret: aws_s3_region
|
|
|
|
bucket:
|
|
|
|
from_secret: aws_s3_bucket
|
2022-09-14 04:36:45 +08:00
|
|
|
endpoint:
|
2023-02-08 05:53:05 +08:00
|
|
|
from_secret: aws_s3_endpoint
|
|
|
|
path_style:
|
|
|
|
from_secret: aws_s3_path_style
|
2019-07-07 09:40:02 +08:00
|
|
|
source: "dist/release/*"
|
2019-04-26 01:06:53 +08:00
|
|
|
strip_prefix: dist/release/
|
2019-07-07 09:40:02 +08: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-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: release-branch-release
|
|
|
|
pull: always
|
2021-10-10 20:48:51 +08:00
|
|
|
image: woodpeckerci/plugin-s3:latest
|
2019-07-07 09:40:02 +08:00
|
|
|
settings:
|
2019-04-26 01:06:53 +08:00
|
|
|
acl: public-read
|
2021-06-30 04:36:05 +08:00
|
|
|
bucket: gitea-artifacts
|
2022-09-14 04:36:45 +08:00
|
|
|
endpoint:
|
|
|
|
from_secret: aws_endpoint
|
2019-07-07 09:40:02 +08:00
|
|
|
source: "dist/release/*"
|
2019-04-26 01:06:53 +08:00
|
|
|
strip_prefix: dist/release/
|
2019-07-07 09:40:02 +08: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-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08:00
|
|
|
- name: release
|
|
|
|
pull: always
|
2021-10-10 20:48:51 +08:00
|
|
|
image: woodpeckerci/plugin-s3:latest
|
2019-07-07 09:40:02 +08:00
|
|
|
settings:
|
2023-02-08 05:53:05 +08:00
|
|
|
acl:
|
|
|
|
from_secret: aws_s3_acl
|
|
|
|
region:
|
|
|
|
from_secret: aws_s3_region
|
|
|
|
bucket:
|
|
|
|
from_secret: aws_s3_bucket
|
2022-09-14 04:36:45 +08:00
|
|
|
endpoint:
|
2023-02-08 05:53:05 +08:00
|
|
|
from_secret: aws_s3_endpoint
|
|
|
|
path_style:
|
|
|
|
from_secret: aws_s3_path_style
|
2019-07-07 09:40:02 +08:00
|
|
|
source: "dist/release/*"
|
2019-04-26 01:06:53 +08:00
|
|
|
strip_prefix: dist/release/
|
2022-08-26 23:34:40 +08:00
|
|
|
target: /tea/main
|
2019-07-07 09:40:02 +08:00
|
|
|
environment:
|
|
|
|
AWS_ACCESS_KEY_ID:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
AWS_SECRET_ACCESS_KEY:
|
|
|
|
from_secret: aws_secret_access_key
|
|
|
|
when:
|
|
|
|
branch:
|
2022-08-26 23:34:40 +08:00
|
|
|
- main
|
2019-07-07 09:40:02 +08:00
|
|
|
event:
|
|
|
|
- push
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-11-08 10:44:07 +08:00
|
|
|
- name: gitea
|
2019-07-07 09:40:02 +08:00
|
|
|
pull: always
|
2019-11-15 17:33:56 +08:00
|
|
|
image: plugins/gitea-release:1
|
2019-07-07 09:40:02 +08:00
|
|
|
settings:
|
2019-04-26 01:06:53 +08:00
|
|
|
files:
|
2019-07-07 09:40:02 +08:00
|
|
|
- "dist/release/*"
|
2019-11-08 10:44:07 +08:00
|
|
|
base_url: https://gitea.com
|
|
|
|
api_key:
|
|
|
|
from_secret: gitea_token
|
2019-07-07 09:40:02 +08:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2019-04-26 01:06:53 +08:00
|
|
|
|
2019-07-07 09:40:02 +08: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-29 05:10:20 +08:00
|
|
|
- failure
|