dbweb/.drone.yml
Lunny Xiao faec90227c
All checks were successful
continuous-integration/drone/push Build is passing
update drone
2020-10-25 17:36:54 +08:00

46 lines
978 B
YAML

---
kind: pipeline
name: testing
trigger:
event:
- push
- pull_request
steps:
- name: test
image: golang:1.15
commands:
- go build -mod=vendor
- go vet -mod=vendor ./...
- go test -mod=vendor -v -race -coverprofile=coverage.txt -covermode=atomic ./...
---
kind: pipeline
name: release-tag
trigger:
event:
- tag
depends_on:
- testing
steps:
- name: release-build
pull: always
image: golang:1.15
commands:
- make generate
- go build -mod=vendor -ldflags="-s -w -X 'main.Version=${DRONE_TAG}'" -o bin/dbweb-${DRONE_TAG}-linux-amd64
- GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags="-s -w -X 'main.Version=${DRONE_TAG}'" -o bin/dbweb-${DRONE_TAG}-windows-amd64.exe
environment:
GO111MODULE: on
- name: release-tag-gitea
pull: always
image: plugins/gitea-release:latest
settings:
files:
- "bin/*"
base_url: https://gitea.com
title: '${DRONE_TAG} is released'
api_key:
from_secret: gitea_token