Skip to content

Commit

Permalink
chore(release): autogenerate release notes (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
peknur authored Nov 20, 2023
1 parent 13e95d6 commit 4c0e4fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
with:
go-version: '1.20'

- name: Get release notes
run: make release-notes > .release_notes

- name: Create release
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: -f .goreleaser.yaml release --clean
args: -f .goreleaser.yaml release --clean --release-notes=.release_notes
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ temp/
.DS_Store
vendor/
dist/
# Generated release notes
.release_notes
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ build-plugin:

.PHONY: build
build: build-plugin

.PHONY: release-notes
release-notes: CHANGELOG_HEADER = ^\#\# \[
release-notes: CHANGELOG_VERSION = $(subst v,,$(TAG))
release-notes:
@awk \
'/${CHANGELOG_HEADER}${CHANGELOG_VERSION}/ { flag = 1; next } \
/${CHANGELOG_HEADER}/ { if ( flag ) { exit; } } \
flag { if ( n ) { print prev; } n++; prev = $$0 }' \
CHANGELOG.md

0 comments on commit 4c0e4fc

Please sign in to comment.