mirror of
https://github.com/thegeeklab/drone-template-lib.git
synced 2024-09-28 18:28:10 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0eaa1da5c3 | |||
951e032630 | |||
|
f5667a49d3 | ||
749f398891 | |||
b3ea099e62 |
@ -1,2 +0,0 @@
|
||||
*
|
||||
!dist/
|
178
.drone.jsonnet
178
.drone.jsonnet
@ -1,178 +0,0 @@
|
||||
local PipelineTest(deps=[],) = {
|
||||
kind: 'pipeline',
|
||||
name: 'test',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'deps',
|
||||
image: 'golang:1.19',
|
||||
commands: [
|
||||
'make deps',
|
||||
],
|
||||
volumes: [
|
||||
{
|
||||
name: 'godeps',
|
||||
path: '/go',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'lint',
|
||||
image: 'golang:1.19',
|
||||
commands: [
|
||||
'make lint',
|
||||
],
|
||||
volumes: [
|
||||
{
|
||||
name: 'godeps',
|
||||
path: '/go',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'test',
|
||||
image: 'golang:1.19',
|
||||
commands: [
|
||||
'make test',
|
||||
],
|
||||
volumes: [
|
||||
{
|
||||
name: 'godeps',
|
||||
path: '/go',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
volumes: [
|
||||
{
|
||||
name: 'godeps',
|
||||
temp: {},
|
||||
},
|
||||
],
|
||||
depends_on: deps,
|
||||
trigger: {
|
||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineRelease(deps=[],) = {
|
||||
kind: 'pipeline',
|
||||
image_pull_secrets: ['docker_config'],
|
||||
name: 'release',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'changelog-generate',
|
||||
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',
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'publish',
|
||||
image: 'plugins/github-release',
|
||||
settings: {
|
||||
overwrite: true,
|
||||
api_key: {
|
||||
from_secret: 'github_token',
|
||||
},
|
||||
title: '${DRONE_TAG}',
|
||||
note: 'CHANGELOG.md',
|
||||
},
|
||||
when: {
|
||||
ref: [
|
||||
'refs/tags/**',
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
depends_on: deps,
|
||||
trigger: {
|
||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineDocs(deps=[],) = {
|
||||
kind: 'pipeline',
|
||||
name: 'docs',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'markdownlint',
|
||||
image: 'thegeeklab/markdownlint-cli',
|
||||
commands: [
|
||||
"markdownlint 'README.md' 'CONTRIBUTING.md'",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'spellcheck',
|
||||
image: 'thegeeklab/alpine-tools',
|
||||
commands: [
|
||||
"spellchecker --files 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions",
|
||||
],
|
||||
environment: {
|
||||
FORCE_COLOR: true,
|
||||
NPM_CONFIG_LOGLEVEL: 'error',
|
||||
},
|
||||
},
|
||||
],
|
||||
depends_on: deps,
|
||||
trigger: {
|
||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
||||
},
|
||||
};
|
||||
|
||||
local PipelineNotifications(deps=[],) = {
|
||||
kind: 'pipeline',
|
||||
name: 'notifications',
|
||||
platform: {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: 'matrix',
|
||||
image: 'thegeeklab/drone-matrix',
|
||||
settings: {
|
||||
homeserver: { from_secret: 'matrix_homeserver' },
|
||||
roomid: { from_secret: 'matrix_roomid' },
|
||||
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 }}',
|
||||
username: { from_secret: 'matrix_username' },
|
||||
password: { from_secret: 'matrix_password' },
|
||||
},
|
||||
when: {
|
||||
status: ['success', 'failure'],
|
||||
},
|
||||
},
|
||||
],
|
||||
depends_on: deps,
|
||||
trigger: {
|
||||
ref: ['refs/heads/main', 'refs/tags/**'],
|
||||
status: ['success', 'failure'],
|
||||
},
|
||||
};
|
||||
|
||||
[
|
||||
PipelineTest(),
|
||||
PipelineRelease(deps=['test'],),
|
||||
PipelineDocs(deps=['release']),
|
||||
PipelineNotifications(deps=['docs']),
|
||||
]
|
@ -135,7 +135,7 @@ steps:
|
||||
from_secret: matrix_password
|
||||
roomid:
|
||||
from_secret: matrix_roomid
|
||||
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 }}"
|
||||
template: "Status: **{{ .Build.Status }}**<br/> Build: [{{ .Repo.Owner }}/{{ .Repo.Name }}]({{ .Build.Link }}){{ if .Build.Branch }} ({{ .Build.Branch }}){{ end }} by {{ .Commit.Author }}<br/> Message: {{ .Commit.Message.Title }}"
|
||||
username:
|
||||
from_secret: matrix_username
|
||||
when:
|
||||
@ -156,6 +156,6 @@ depends_on:
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 84521962c13647c129172e114ade6a46c8d4564be36f654fce48b56583f27d65
|
||||
hmac: 07d26db9bce4a7b4b2edde53e67e712aff37eb8ad0e9bfb3e11f6fc8c08ea431
|
||||
|
||||
...
|
||||
|
9
Makefile
9
Makefile
@ -1,7 +1,7 @@
|
||||
# renovate: datasource=github-releases depName=mvdan/gofumpt
|
||||
GOFUMPT_PACKAGE_VERSION := v0.4.0
|
||||
# renovate: datasource=github-releases depName=golangci/golangci-lint
|
||||
GOLANGCI_LINT_PACKAGE_VERSION := v1.50.1
|
||||
GOLANGCI_LINT_PACKAGE_VERSION := v1.51.1
|
||||
|
||||
EXECUTABLE := drone-template-lib
|
||||
|
||||
@ -22,6 +22,11 @@ GENERATE ?=
|
||||
XGO_VERSION := go-1.19.x
|
||||
XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64
|
||||
|
||||
TARGETOS ?= linux
|
||||
TARGETARCH ?= amd64
|
||||
ifneq ("$(TARGETVARIANT)","")
|
||||
GOARM ?= $(subst v,,$(TARGETVARIANT))
|
||||
endif
|
||||
TAGS ?= netgo
|
||||
|
||||
ifndef VERSION
|
||||
@ -69,7 +74,7 @@ test:
|
||||
build: $(DIST)/$(EXECUTABLE)
|
||||
|
||||
$(DIST)/$(EXECUTABLE): $(SOURCES)
|
||||
$(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE)
|
||||
GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) GOARM=$(GOARM) $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE)
|
||||
|
||||
$(DIST_DIRS):
|
||||
mkdir -p $(DIST_DIRS)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# drone-template-lib
|
||||
|
||||
> DISCONTINUED: This library is no longer maintained and will be removed in the future. The template helpers are now part of [thegeeklab/drone-plugin-lib](https://github.com/thegeeklab/drone-plugin-lib).
|
||||
|
||||
[![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-template-lib?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/drone-template-lib)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/thegeeklab/drone-template-lib)](https://goreportcard.com/report/github.com/thegeeklab/drone-template-lib)
|
||||
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/drone-template-lib)](https://github.com/thegeeklab/drone-template-lib/graphs/contributors)
|
||||
|
Loading…
Reference in New Issue
Block a user