wg-quicker/.drone.yml

104 lines
1.6 KiB
YAML
Raw Normal View History

2021-01-20 15:24:38 +01:00
---
kind: pipeline
type: docker
2021-01-20 15:24:38 +01:00
name: default
golang-image: &golang-image golang:1.17-alpine
gobin-volume: &gobin-volume
name: gobin
path: /go/bin
usr-volume: &usr-volume
name: usr
path: /usr
deps-command: &deps-command apk add build-base git
2021-01-20 15:24:38 +01:00
steps:
2021-01-22 11:27:22 +01:00
- name: tags
image: alpine/git
2021-01-20 15:24:38 +01:00
commands:
- git fetch --tags
2021-01-22 11:27:22 +01:00
- name: submodules
image: alpine/git
commands:
- git submodule init
2021-01-22 11:57:43 +01:00
- git submodule update
2021-04-16 14:26:44 +02:00
depends_on:
- tags
2021-01-21 12:24:32 +01:00
- name: install-tools
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- *deps-command
- make install-tools
2021-01-20 15:24:38 +01:00
- name: lint
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2021-01-20 15:24:38 +01:00
commands:
- make lint
2021-01-21 12:24:32 +01:00
depends_on:
- tags
2021-04-16 14:26:44 +02:00
- submodules
- install-tools
2021-01-20 15:24:38 +01:00
- name: test
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2021-01-20 15:24:38 +01:00
commands:
2021-01-21 12:24:32 +01:00
- make test
depends_on:
- install-tools
- tags
- lint
2021-04-16 14:25:25 +02:00
- submodules
2021-01-20 15:24:38 +01:00
- name: build
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2021-01-20 15:24:38 +01:00
commands:
- make build
depends_on:
2021-04-16 14:25:25 +02:00
- lint
- test
2021-01-25 09:18:46 +01:00
when:
event:
exclude:
2021-01-27 11:07:21 +01:00
- tag
2021-01-20 15:24:38 +01:00
- name: release
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2021-01-20 15:24:38 +01:00
environment:
2021-01-27 10:15:34 +01:00
GITHUB_TOKEN:
from_secret: github_token
2021-01-20 15:24:38 +01:00
commands:
2021-01-21 12:24:32 +01:00
- goreleaser release --rm-dist --parallelism=1
2021-01-25 09:18:46 +01:00
depends_on:
2021-04-16 14:25:25 +02:00
- lint
- test
2021-01-25 09:18:46 +01:00
when:
event:
2021-01-27 11:07:21 +01:00
- tag
volumes:
- name: gobin
temp: {}
- name: usr
temp: {}