mirror of
https://github.com/suzuki-shunsuke/drone-jsonnet-generator.git
synced 2026-02-10 08:32:51 +02:00
78 lines
1.5 KiB
YAML
78 lines
1.5 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.17.1
|
|
commands:
|
|
- golangci-lint run
|
|
- 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:
|
|
CODECOV_TOKEN:
|
|
from_secret: codecov_token
|
|
- name: fetch tags
|
|
image: plugins/git
|
|
commands:
|
|
- git fetch --tags
|
|
when:
|
|
event:
|
|
- tag
|
|
- 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
|
|
when:
|
|
event:
|
|
- pull_request
|