url-parser/.drone.jsonnet

175 lines
3.4 KiB
Plaintext
Raw Normal View History

2020-09-21 18:24:51 +00:00
local PipelineTest = {
kind: 'pipeline',
name: 'test',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'deps',
2022-08-05 10:55:36 +00:00
image: 'golang:1.19',
2020-09-21 18:24:51 +00:00
commands: [
'make deps',
2020-09-21 18:24:51 +00:00
],
volumes: [
{
name: 'godeps',
2020-09-21 18:24:51 +00:00
path: '/go',
},
],
},
{
name: 'lint',
2022-08-05 10:55:36 +00:00
image: 'golang:1.19',
2020-09-21 18:24:51 +00:00
commands: [
'make lint',
2020-09-21 18:24:51 +00:00
],
volumes: [
{
name: 'godeps',
2020-09-21 18:24:51 +00:00
path: '/go',
},
],
},
{
name: 'test',
2022-08-05 10:55:36 +00:00
image: 'golang:1.19',
2020-09-21 18:24:51 +00:00
commands: [
'make test',
2020-09-21 18:24:51 +00:00
],
volumes: [
{
name: 'godeps',
2020-09-21 18:24:51 +00:00
path: '/go',
},
],
},
{
name: 'coverage',
image: 'plugins/codecov',
settings: {
token: {
from_secret: 'codecov_token',
},
files: [
'coverage.out',
2020-09-21 18:24:51 +00:00
],
},
},
],
volumes: [
{
name: 'godeps',
2020-09-21 18:24:51 +00:00
temp: {},
},
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
2020-09-21 18:24:51 +00:00
},
};
local PipelineBuildBinaries = {
kind: 'pipeline',
name: 'build-binaries',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'build',
2022-08-05 10:55:36 +00:00
image: 'techknowlogick/xgo:go-1.19.x',
2020-09-21 18:24:51 +00:00
commands: [
'make release',
2020-09-21 18:24:51 +00:00
],
},
{
name: 'executable',
image: 'alpine',
commands: [
'$(find dist/ -executable -type f -iname ${DRONE_REPO_NAME}-linux-amd64) --help',
2020-09-21 18:24:51 +00:00
],
},
2021-02-15 20:18:08 +00:00
{
name: 'changelog-generate',
2021-02-15 20:18:08 +00:00
image: 'thegeeklab/git-chglog',
commands: [
'git fetch -tq',
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
],
},
{
name: 'changelog-format',
image: 'thegeeklab/alpine-tools',
commands: [
'prettier CHANGELOG.md',
'prettier -w CHANGELOG.md',
],
},
2020-09-21 18:24:51 +00:00
{
name: 'publish',
image: 'plugins/github-release',
settings: {
overwrite: true,
api_key: {
from_secret: 'github_token',
},
files: ['dist/*'],
2020-09-21 18:24:51 +00:00
title: '${DRONE_TAG}',
note: 'CHANGELOG.md',
},
when: {
ref: [
'refs/tags/**',
],
},
},
],
depends_on: [
'test',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
2020-09-21 18:24:51 +00:00
},
};
local PipelineNotifications = {
kind: 'pipeline',
name: 'notifications',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'matrix',
image: 'thegeeklab/drone-matrix',
2020-09-21 18:24:51 +00:00
settings: {
homeserver: { from_secret: 'matrix_homeserver' },
roomid: { from_secret: 'matrix_roomid' },
2021-09-22 07:57:45 +00:00
template: 'Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}',
2020-09-21 18:24:51 +00:00
username: { from_secret: 'matrix_username' },
password: { from_secret: 'matrix_password' },
},
when: {
status: ['success', 'failure'],
},
},
],
depends_on: [
'build-binaries',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**'],
2020-09-21 18:24:51 +00:00
status: ['success', 'failure'],
},
};
[
PipelineTest,
PipelineBuildBinaries,
PipelineNotifications,
]