Skip to content

Commit da32e3a

Browse files
author
Adam McKee
committed
verify release has changelog content before releasing
1 parent 5429405 commit da32e3a

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
FILE=$1
5+
6+
found=$(awk -v p="## Unreleased" -F":" '$0 ~ p{f=1;next} /## /{f=0} f' "$FILE" | grep -c .)
7+
8+
if ((found == 0)); then
9+
exit 1
10+
fi

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ jobs:
2020
verified:
2121
uses: ./.github/workflows/verify.yml
2222

23+
check-changelog:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- run: ./.github/workflows/changelog_check.sh CHANGELOG.md
28+
2329
publish-cargo-crate:
24-
needs: verified
30+
needs: [ verified, check-changelog ]
2531
runs-on: ubuntu-latest
2632
steps:
2733
- uses: actions/checkout@v4

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased - ReleaseDate
8+
## Unreleased
99

1010
## 0.0.9 - 2024-04-15
1111

‎release.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tag-name = "v{{version}}"
55
pre-release-commit-message = "cargo release"
66

77
pre-release-replacements = [
8-
{ file = "CHANGELOG.md", search = "## Unreleased - ReleaseDate", replace = "## Unreleased - ReleaseDate\n\n## {{version}} - {{date}}", exactly = 1 },
8+
{ file = "CHANGELOG.md", search = "## Unreleased", replace = "## Unreleased\n\n## {{version}} - {{date}}", exactly = 1 },
99
{ file = "CHANGELOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}", exactly = 1 },
1010
{ file = "CHANGELOG.md", search = "\\[Unreleased\\]", replace = "[Unreleased]: https://github.com/eighty4/cquill/compare/{{tag_name}}...HEAD\n[{{version}}]", exactly = 1 },
1111
]

0 commit comments

Comments
 (0)