Skip to content

Commit

Permalink
feat: introduce structured changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
omissis committed Sep 11, 2022
1 parent 8ad3be4 commit b3cb2ae
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
Empty file added .changes/unreleased/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions .changes/v0.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## v0.1.0 - 2022-09-11
### Added
* validate command
* verify command
* yaml configuration support
19 changes: 19 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '* {{.Body}}'
kinds:
- label: Added
- label: Changed
- label: Deprecated
- label: Removed
- label: Fixed
- label: Security
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1
endOfVersion: 1
26 changes: 24 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ name: tag
on:
push:
tags:
- 'v*'
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+'

permissions:
contents: write
Expand All @@ -14,7 +17,7 @@ concurrency:
cancel-in-progress: true

jobs:
release:
qa:
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -38,6 +41,11 @@ jobs:
args: -v --color=always --config=.rules/.golangci.yml ./...
- name: Run tests
run: go test -v ./...
prerelease:
needs: qa
if: ${{ contains(github.ref_name, '-') }}
runs-on: ubuntu-22.04
steps:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
Expand All @@ -47,3 +55,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: '1.19.0'
release:
needs: qa
if: ${{ !contains(github.ref_name, '-') }}
runs-on: ubuntu-22.04
steps:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: '1.11.2'
args: release --debug --rm-dist --release-notes=.changes/${{ github.ref_name }}.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: '1.19.0'
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).


## v0.1.0 - 2022-09-11
### Added
* validate command
* verify command
* yaml configuration support

0 comments on commit b3cb2ae

Please # to comment.