Files
drone-jsonnet-generator/.drone.yml

84 lines
1.6 KiB
YAML

---
kind: pipeline
name: commitlint
steps:
- name: npm install
image: &node_image node:10.16.0-alpine
commands:
- npm i
- name: tag/commitlint
image: *node_image
commands:
- npx commitlint --from HEAD~1 --to HEAD
when:
event:
- tag
- push
- name: pr/commitlint
image: *node_image
commands:
- npx commitlint --from master --to HEAD || exit 1
when:
event:
- pull_request
---
kind: pipeline
name: build
workspace:
base: /go
path: src/github.com/suzuki-shunsuke/drone-jsonnet-generator
steps:
- name: golangci-lint
image: golangci/golangci-lint:v1.26.0
commands:
- golangci-lint run
environment:
GO111MODULE: on
- name: codecov
image: &image_go golang:1.12.5
commands:
# bash and cgo seem to be required
- bash scripts/codecov-test.sh
- curl -s https://codecov.io/bash > /tmp/codecov.sh
- test "$LOCAL" == "true" || bash /tmp/codecov.sh
environment:
GO111MODULE: on
CODECOV_TOKEN:
from_secret: codecov_token
- name: fetch tags
image: plugins/git
commands:
- git fetch --tags
when:
event:
- tag
- pull_request
- name: release
image: &goreleaser goreleaser/goreleaser:v0.109.0
commands:
- goreleaser release
environment:
GO111MODULE: on
GITHUB_TOKEN:
from_secret: github_token
when:
event:
- tag
- name: git
image: plugins/git
commands:
# bash not found
- sh scripts/tag-dummy.sh
when:
event:
- pull_request
- name: release/pr
image: *goreleaser
commands:
- goreleaser release --skip-publish
environment:
GO111MODULE: on
when:
event:
- pull_request