ci: add release pipeline
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
Robert Kaussow 2022-12-18 16:03:26 +01:00
parent 60f70d3fd8
commit 358a2688e3
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 106 additions and 3 deletions

23
.chglog/CHANGELOG.tpl.md Executable file
View File

@ -0,0 +1,23 @@
# Changelog
{{ range .Versions -}}
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pulls/${2}") | trim }}
{{ end }}
{{- end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

25
.chglog/config.yml Executable file
View File

@ -0,0 +1,25 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://gitea.rknet.org/infra/hcloud-server-tf
options:
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
chore: Others
test: Testing
ci: CI Pipeline
docs: Documentation
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE

View File

@ -1,6 +1,6 @@
--- ---
kind: pipeline kind: pipeline
name: check name: test
platform: platform:
os: linux os: linux
@ -13,13 +13,18 @@ steps:
commands: commands:
- git diff-tree --check $(git hash-object -t tree /dev/null) HEAD - git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
- name: tflint
image: ghcr.io/terraform-linters/tflint
commands:
- tflint --color
- name: terraform - name: terraform
pull: always pull: always
image: jmccann/drone-terraform:8 image: jmccann/drone-terraform:8
settings: settings:
actions: actions:
- validate - validate
tf_version: 1.2.0 tf_version: 1.3.0
node: node:
zone: mgmt zone: mgmt
@ -30,8 +35,58 @@ trigger:
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
---
kind: pipeline
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}
depends_on:
- tags
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
depends_on:
- changelog-generate
- name: publish-gitea
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.rknet.org
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
depends_on:
- publish-dockerhub
- publish-quay
trigger:
ref:
- refs/heads/main
- refs/pull/**
- refs/tags/**
depends_on:
- test
--- ---
kind: signature kind: signature
hmac: ec825d5879e3dc1d26bdc619143cf2ea41d5183c2d7b892498b21103379675c2 hmac: 8811fe550ab6c86d00c61525cfb9decaf56d324633c3a7171057d2f12cf5b86d
... ...