127 lines
2.3 KiB
YAML
127 lines
2.3 KiB
YAML
---
|
|
kind: pipeline
|
|
name: compliance
|
|
|
|
platform:
|
|
os: linux
|
|
arch: arm64
|
|
|
|
trigger:
|
|
event:
|
|
- pull_request
|
|
|
|
steps:
|
|
- name: build
|
|
pull: always
|
|
image: golang:1.20
|
|
environment:
|
|
GOPROXY: https://goproxy.io,direct
|
|
commands:
|
|
- go test -race ./...
|
|
- go build
|
|
|
|
- name: check
|
|
pull: always
|
|
image: golang:1.20
|
|
environment:
|
|
GOPROXY: https://goproxy.io,direct
|
|
commands:
|
|
- make lint
|
|
|
|
- name: discord
|
|
pull: always
|
|
image: appleboy/drone-discord:1
|
|
environment:
|
|
DISCORD_WEBHOOK_ID:
|
|
from_secret: discord_webhook_id
|
|
DISCORD_WEBHOOK_TOKEN:
|
|
from_secret: discord_webhook_token
|
|
when:
|
|
event:
|
|
- push
|
|
- tag
|
|
status:
|
|
- changed
|
|
- failure
|
|
|
|
---
|
|
kind: pipeline
|
|
name: release
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
- tag
|
|
|
|
steps:
|
|
- name: fetch-tags
|
|
pull: always
|
|
image: docker:git
|
|
commands:
|
|
- git fetch --tags --force
|
|
|
|
- name: release
|
|
pull: always
|
|
image: techknowlogick/xgo:latest
|
|
environment:
|
|
GOPROXY: https://goproxy.io,direct
|
|
commands:
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
- make release
|
|
|
|
- name: bucket-main
|
|
pull: always
|
|
image: woodpeckerci/plugin-s3:latest
|
|
settings:
|
|
acl: public-read
|
|
bucket: gitea-artifacts
|
|
endpoint: https://ams3.digitaloceanspaces.com
|
|
source: "dist/release/*"
|
|
strip_prefix: dist/release/
|
|
target: /changelog-tool/main
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: aws_access_key_id
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: aws_secret_access_key
|
|
when:
|
|
event:
|
|
- push
|
|
|
|
- name: bucket-tag
|
|
pull: always
|
|
image: woodpeckerci/plugin-s3:latest
|
|
settings:
|
|
acl: public-read
|
|
bucket: gitea-artifacts
|
|
endpoint: https://ams3.digitaloceanspaces.com
|
|
source: "dist/release/*"
|
|
strip_prefix: dist/release/
|
|
target: "/changelog-tool/${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
|
|
|
|
- name: gitea
|
|
pull: always
|
|
image: plugins/gitea-release:1
|
|
settings:
|
|
api_key:
|
|
from_secret: gitea_token
|
|
base_url: https://gitea.com
|
|
files:
|
|
- "dist/release/*"
|
|
when:
|
|
event:
|
|
- tag |