Skip to content

Commit 64cad7c

Browse files
bricefclaude
andcommitted
Auto-generate CHANGELOG.md on release
just release now generates a changelog entry from git log since the previous tag, prepends it to CHANGELOG.md, commits, then tags. The changelog commit is included in the tagged release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7579e2e commit 64cad7c

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
All notable changes to TaskFlow are documented here. Generated automatically on each release.

justfile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,30 @@ release tag:
133133
echo "Error: working tree is dirty — commit or stash first" >&2
134134
exit 1
135135
fi
136+
137+
# Generate changelog entry.
138+
PREV=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
139+
DATE=$(date +%Y-%m-%d)
140+
ENTRY="## {{tag}} — ${DATE}"$'\n\n'
141+
if [ -n "$PREV" ]; then
142+
ENTRY+=$(git log --pretty=format:"- %s" "${PREV}..HEAD" --no-merges)
143+
else
144+
ENTRY+=$(git log --pretty=format:"- %s" --no-merges)
145+
fi
146+
ENTRY+=$'\n'
147+
148+
# Prepend to CHANGELOG.md (after the header line).
149+
HEADER=$(head -3 CHANGELOG.md)
150+
BODY=$(tail -n +4 CHANGELOG.md)
151+
printf '%s\n\n%s\n%s' "$HEADER" "$ENTRY" "$BODY" > CHANGELOG.md
152+
153+
git add CHANGELOG.md
154+
git commit -m "Update CHANGELOG for {{tag}}"
155+
136156
echo "Tagging {{tag}}..."
137157
git tag -a "{{tag}}" -m "Release {{tag}}"
138-
echo "Pushing tag to origin..."
139-
git push origin "{{tag}}"
158+
echo "Pushing commits and tag to origin..."
159+
git push origin main "{{tag}}"
140160
echo "Done. CI will build and push docker.io/fractallambda/taskflow:{{tag}}"
141161

142162
# Clean build artifacts

0 commit comments

Comments
 (0)