2018-12-01 13:56:33 +08:00
|
|
|
kind: pipeline
|
|
|
|
name: default
|
2018-03-26 22:00:02 +08:00
|
|
|
|
2018-12-01 13:56:33 +08:00
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
image: golang:1.11
|
|
|
|
pull: true
|
|
|
|
environment:
|
2018-12-01 14:45:00 +08:00
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: amd64
|
2018-12-01 13:56:33 +08:00
|
|
|
commands:
|
|
|
|
- export FILENAME=${DRONE_REPO_NAME}-${GOOS}-${GOARCH}
|
|
|
|
- if [ "$GOOS" = "windows" ]; then export FILENAME=$FILENAME.exe; fi
|
|
|
|
- go build -ldflags "-s -w" -o dist/$FILENAME
|
|
|
|
- name: release
|
|
|
|
image: plugins/github-release
|
|
|
|
settings:
|
2018-03-26 21:00:11 +08:00
|
|
|
files:
|
2018-12-01 13:56:33 +08:00
|
|
|
- dist/*
|
|
|
|
api_key:
|
|
|
|
from_secret: github_token
|
2018-12-01 14:55:40 +08:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|