Drone 1.0 syntax
parent
25dacd45ab
commit
346e04401d
50
.drone.yml
50
.drone.yml
|
@ -1,30 +1,24 @@
|
||||||
workspace:
|
kind: pipeline
|
||||||
base: /go
|
name: default
|
||||||
|
|
||||||
matrix:
|
steps:
|
||||||
GO_VERSION:
|
- name: build
|
||||||
- "1.11"
|
image: golang:1.11
|
||||||
GOOS:
|
pull: true
|
||||||
- linux
|
environment:
|
||||||
- windows
|
- CGO_ENABLED=0
|
||||||
- darwin
|
- GOOS=linux
|
||||||
GOARCH:
|
- GOARCH=amd64
|
||||||
- amd64
|
commands:
|
||||||
|
- export FILENAME=${DRONE_REPO_NAME}-${GOOS}-${GOARCH}
|
||||||
pipeline:
|
- if [ "$GOOS" = "windows" ]; then export FILENAME=$FILENAME.exe; fi
|
||||||
build:
|
- go build -ldflags "-s -w" -o dist/$FILENAME
|
||||||
image: golang:${GO_VERSION}
|
- name: release
|
||||||
pull: true
|
image: plugins/github-release
|
||||||
environment:
|
settings:
|
||||||
- CGO_ENABLED=0
|
|
||||||
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
|
|
||||||
release:
|
|
||||||
image: plugins/github-release
|
|
||||||
secrets: [ github_token ]
|
|
||||||
files:
|
files:
|
||||||
- dist/*
|
- dist/*
|
||||||
when:
|
api_key:
|
||||||
event: tag
|
from_secret: github_token
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
|
Loading…
Reference in New Issue