Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,20 @@ jobs:
cd dist
sha256sum * > checksums.txt

- uses: taiki-e/install-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tool: git-cliff@2

- name: Generate release notes
- name: Extract release notes from CHANGELOG.md
if: startsWith(github.ref, 'refs/tags/')
env:
TAG: ${{ github.ref_name }}
run: |
git-cliff --tag "${{ github.ref_name }}" --latest --output release-notes.md
awk -v tag="$TAG" '
$0 ~ "^## " tag " " {found=1; next}
found && /^## / {exit}
found {print}
' CHANGELOG.md > release-notes.md
if [ ! -s release-notes.md ]; then
echo "::error::No CHANGELOG.md section found for $TAG; update the changelog before tagging." >&2
exit 1
fi

- name: Publish semver release
if: startsWith(github.ref, 'refs/tags/')
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Once the run completes, anyone with read access can download the artifact for th

## Releasing

Releases are triggered by pushing a semver tag. The CI workflow builds 5-platform binaries, generates a changelog via `git-cliff`, and publishes a GitHub release.
Releases are triggered by pushing a semver tag. The CI workflow builds 5-platform binaries and publishes a GitHub release. The release notes are the matching version section extracted from `CHANGELOG.md` (the single source of truth), so the changelog must be committed before tagging.

Prerequisites: [`git-cliff`](https://git-cliff.org/docs/installation).

Expand Down
1 change: 1 addition & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ commit_parsers = [
{ message = "^refactor", group = "Refactor" },
{ message = "^docs", group = "Documentation" },
{ message = "^test", group = "Testing" },
{ message = "^chore: release", skip = true },
{ message = "^chore", group = "Miscellaneous" },
{ message = "^ci", skip = true },
{ message = "^style", skip = true },
Expand Down