Skip to content

Commit 897fecb

Browse files
authored
Merge pull request #11 from franccesco/feat/changelog-and-releases
feat: add changelog and automated GitHub releases
2 parents a657d34 + 1f02bec commit 897fecb

3 files changed

Lines changed: 353 additions & 25 deletions

File tree

.claude/agents/version-control-engineer.md

Lines changed: 82 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,65 @@ chore: bump version to 0.19.0
6969
git status
7070

7171
# 2. Update version in pyproject.toml
72-
# Edit: version = "0.19.0"
72+
# Edit: version = "0.20.0"
7373

74-
# 3. Commit version bump
75-
git add pyproject.toml
76-
git commit -m "chore: bump version to 0.19.0"
74+
# 3. Update CHANGELOG.md (see Changelog section below)
7775

78-
# 4. Create git tag
79-
git tag -a v0.19.0 -m "Release v0.19.0"
76+
# 4. Commit version bump and changelog
77+
git add pyproject.toml CHANGELOG.md
78+
git commit -m "chore: bump version to 0.20.0"
79+
80+
# 5. Create git tag
81+
git tag -a v0.20.0 -m "Release v0.20.0"
82+
```
83+
84+
## Changelog Management
85+
86+
### Changelog Location
87+
- File: `CHANGELOG.md`
88+
- Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
89+
90+
### Changelog Structure
91+
92+
The changelog uses these categories under each version:
93+
- **Added**: New features
94+
- **Changed**: Changes to existing functionality
95+
- **Deprecated**: Features that will be removed
96+
- **Removed**: Features that were removed
97+
- **Fixed**: Bug fixes
98+
- **Security**: Security-related changes
99+
100+
### Updating the Changelog
101+
102+
**During Development:**
103+
1. Add changes to the `[Unreleased]` section as they are merged
104+
2. Use the appropriate category (Added, Changed, Fixed, etc.)
105+
3. Write clear, user-focused descriptions
106+
107+
**During Release:**
108+
1. Rename `[Unreleased]` to `[X.Y.Z] - YYYY-MM-DD`
109+
2. Add a new empty `[Unreleased]` section at the top
110+
3. Update the comparison links at the bottom of the file
111+
112+
**Example Changelog Entry:**
113+
```markdown
114+
## [Unreleased]
115+
116+
### Added
117+
118+
- New bulk delete operation for todos via `client.todo.delete_many()`
119+
120+
### Fixed
121+
122+
- Resolved timeout issue in async operations with large payloads
123+
```
124+
125+
### Changelog Links
126+
127+
Keep the comparison links at the bottom of CHANGELOG.md updated:
128+
```markdown
129+
[Unreleased]: https://github.com/franccesco/bloomy-python/compare/vX.Y.Z...HEAD
130+
[X.Y.Z]: https://github.com/franccesco/bloomy-python/compare/vA.B.C...vX.Y.Z
80131
```
81132

82133
## Pull Request Workflow
@@ -141,36 +192,42 @@ uv run mkdocs build --strict
141192

142193
# 3. Verify all tests pass
143194
# 4. Review recent commits for changelog
144-
git log --oneline v0.18.0..HEAD
195+
git log --oneline v0.19.0..HEAD
145196
```
146197

147198
### Release Steps
148199

149200
```bash
150-
# 1. Update version in pyproject.toml
151-
# 2. Update CHANGELOG.md (if exists)
152-
153-
# 3. Commit release
154-
git add pyproject.toml
155-
git commit -m "chore: bump version to 0.19.0"
201+
# 1. Update CHANGELOG.md
202+
# - Move items from [Unreleased] to new version section
203+
# - Add release date: ## [0.20.0] - 2025-12-10
204+
# - Update comparison links at bottom
156205

157-
# 4. Create annotated tag
158-
git tag -a v0.19.0 -m "Release v0.19.0
206+
# 2. Update version in pyproject.toml
207+
# version = "0.20.0"
159208

160-
Features:
161-
- Added bulk operations support
162-
- Improved async performance
209+
# 3. Commit release
210+
git add CHANGELOG.md pyproject.toml
211+
git commit -m "chore: release v0.20.0"
163212

164-
Fixes:
165-
- Fixed date parsing issue
166-
"
213+
# 4. Create annotated tag (simple message - changelog is in CHANGELOG.md)
214+
git tag -a v0.20.0 -m "Release v0.20.0"
167215

168216
# 5. Push with tags
169217
git push origin main --tags
170218
```
171219

172-
### Post-Release
173-
- Verify GitHub release is created
220+
### Automated GitHub Release
221+
222+
When you push a tag matching `v*`, the GitHub Actions workflow (`.github/workflows/release.yml`) automatically:
223+
1. Extracts the changelog section for that version from CHANGELOG.md
224+
2. Creates a GitHub Release with the changelog as the release body
225+
3. Names the release after the tag (e.g., "v0.20.0")
226+
227+
**No manual GitHub Release creation is needed!**
228+
229+
### Post-Release Verification
230+
- Verify GitHub Release was created at: https://github.com/franccesco/bloomy-python/releases
174231
- Documentation auto-deploys via GitHub Actions
175232
- Manual PyPI publish if needed
176233

@@ -219,6 +276,6 @@ git push origin --delete feature-branch
219276

220277
## Files to Update for Releases
221278

279+
- `CHANGELOG.md` - Release notes (REQUIRED - move items from Unreleased, update links)
222280
- `pyproject.toml` - Version number
223-
- `CHANGELOG.md` - Release notes (if maintained)
224-
- `docs/` - Any version-specific documentation
281+
- `docs/` - Any version-specific documentation (if applicable)

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Extract version from tag
19+
id: version
20+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
21+
22+
- name: Extract changelog for this version
23+
id: changelog
24+
run: |
25+
# Extract the changelog section for this version
26+
version="${{ steps.version.outputs.version }}"
27+
28+
# Use awk to extract the section between this version and the next
29+
changelog=$(awk -v ver="$version" '
30+
/^## \[/ {
31+
if (found) exit
32+
if ($0 ~ "\\[" ver "\\]") found=1
33+
next
34+
}
35+
found && /^## \[/ { exit }
36+
found { print }
37+
' CHANGELOG.md)
38+
39+
# Write to file to preserve formatting
40+
echo "$changelog" > /tmp/release_notes.md
41+
42+
# Set output (escape newlines for GitHub Actions)
43+
{
44+
echo 'notes<<EOF'
45+
cat /tmp/release_notes.md
46+
echo 'EOF'
47+
} >> $GITHUB_OUTPUT
48+
49+
- name: Create GitHub Release
50+
uses: softprops/action-gh-release@v2
51+
with:
52+
name: v${{ steps.version.outputs.version }}
53+
body: ${{ steps.changelog.outputs.notes }}
54+
draft: false
55+
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)