Release Management¶
This guide covers the release management processes for the Bank Statement Separator project, including both automated and manual release workflows.
Overview¶
The project supports two release management approaches:
- Automated Releases (Recommended) - Using release-please with conventional commits
- Manual Releases (Alternative) - For special cases requiring direct control
Complete Workflow Architecture¶
graph TD
A[Developer] --> B[Create Conventional Commit]
B --> C[Push to main branch]
C --> D[CI Workflow]
C --> E[release-please workflow]
C --> F[docs-versioned workflow
deploy-latest]
D --> G[Run tests, linting, security]
E --> H[Analyze commits for version bump]
H --> I{Conventional commits found?}
I -->|No| J[No action]
I -->|Yes| K[Create/Update release PR]
K --> L[PR merged to main]
L --> M[release-please workflow]
M --> N[Create version tag]
N --> O[Trigger repository dispatch]
O --> P[Release workflow]
O --> Q[docs-versioned workflow
deploy-version]
P --> R[release job]
P --> S[publish job]
R --> T[Build & test package]
T --> U[Create GitHub release]
S --> V[Publish to PyPI]
Q --> W[Build versioned docs]
W --> X[Deploy to GitHub Pages]
F --> Y[Build latest docs]
Y --> Z[Deploy to GitHub Pages]
U --> AA[GitHub Release]
V --> BB[PyPI Package]
X --> CC[Versioned Documentation]
Z --> DD[Latest Documentation]
style D fill:#e1f5fe
style E fill:#e1f5fe
style F fill:#e1f5fe
style P fill:#f3e5f5
style Q fill:#f3e5f5
style R fill:#e8f5e8
style S fill:#e8f5e8
Workflow Components¶
🔄 CI Workflow (ci.yml)¶
- Trigger: Push to main/develop branches, PRs
- Purpose: Continuous integration and quality checks
- Actions:
- Run unit and integration tests
- Code formatting and linting (Ruff)
- Security scanning (Bandit)
- Coverage reporting
🔄 Release-Please Workflow (release-please.yml)¶
- Trigger: Push to main branch
- Purpose: Automated semantic versioning
- Actions:
- Analyze conventional commits
- Determine version bumps (major/minor/patch)
- Create/update release PRs with changelogs
- Create version tags on PR merge
- Trigger downstream workflows via repository dispatch
🚀 Release Workflow (release.yml)¶
- Trigger: Tag push or repository dispatch
- Purpose: Package building and publishing
- Jobs:
- release: Build, test, create GitHub release
- publish: Publish to PyPI
📚 Docs-Versioned Workflow (docs-versioned.yml)¶
- Trigger: Push to main, releases, repository dispatch
- Purpose: Documentation deployment and versioning
- Jobs:
- deploy-latest: Deploy latest docs on main push
- deploy-version: Deploy versioned docs on releases
- update-version-selector: Update version dropdown
🔗 Workflow Integration¶
- Repository Dispatch: Reliable cross-workflow communication
- Job Dependencies: Proper sequencing of build/test/deploy
- Conditional Execution: Smart triggering based on event types
- Parallel Processing: Independent jobs run concurrently where possible
Automated Release Process¶
How It Works¶
The automated release process uses release-please to manage versioning and releases based on conventional commit messages.
Workflow Steps¶
- Developer commits with conventional format:
- Release-please analyzes commits and determines version bump:
feat:commits → Minor version (1.0.0 → 1.1.0)fix:commits → Patch version (1.0.0 → 1.0.1)-
BREAKING CHANGE:→ Major version (1.0.0 → 2.0.0) -
Release PR created with:
- Updated
pyproject.tomlversion - Generated changelog
-
Release notes
-
When PR merged:
- Tag created automatically (
v1.1.0) - Release workflow triggered
- Package built and published
Configuration Files¶
release-please-config.json¶
{
"packages": {
".": {
"package-name": "bank-statement-separator",
"changelog-path": "docs/release_notes/CHANGELOG.md",
"release-type": "python",
"tag-format": "v${version}",
"extra-files": ["pyproject.toml"]
}
}
}
.release-please-manifest.json¶
Conventional Commit Format¶
All commits must follow the conventional commit format:
Types¶
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Testing changeschore: Maintenance changes
Examples¶
git commit -m "feat: add PDF boundary detection"
git commit -m "fix: resolve account number extraction bug"
git commit -m "docs: update installation guide"
Manual Release Process¶
When to Use Manual Releases¶
Manual releases are appropriate for:
- Urgent security fixes
- Special versioning requirements
- Testing workflow changes
- One-off releases with specific needs
Step-by-Step Manual Release¶
1. Update Version¶
# Edit pyproject.toml
version = "2.0.2"
# Commit the change
git add pyproject.toml
git commit -m "chore: update version to 2.0.2"
git push origin main
2. Create Release Tag¶
# Create annotated tag
git tag -a v2.0.2 -m "Release v2.0.2
## Changes
- Enhanced PyPI metadata
- Fixed build configuration
## Breaking Changes
- None"
# Push tag
git push origin v2.0.2
3. Trigger Release Workflow¶
- Go to GitHub → Actions tab
- Select "Release" workflow
- Click "Run workflow"
- Enter tag:
v2.0.2 - Click "Run workflow"
4. Monitor and Verify¶
- Check workflow progress in Actions tab
- Verify GitHub release creation
- Confirm PyPI package upload
- Test versioned documentation
Release Workflow Details¶
Jobs and Responsibilities¶
Release Job¶
- Runs tests and builds package
- Creates GitHub release with assets
- Generates release notes
Publish Job¶
- Publishes package to PyPI
- Requires
PYPI_API_TOKENsecret - Only runs on tag pushes or manual triggers
Docs-Version Job¶
- Builds versioned documentation
- Deploys to GitHub Pages subdirectory
- Updates version selector
Workflow Triggers¶
Automatic Triggers¶
Manual Triggers¶
Version Management¶
Semantic Versioning¶
The project follows Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
Version File Updates¶
Release-please automatically updates:
pyproject.tomlversion field.release-please-manifest.jsonversion tracking- Creates versioned changelog
Manual Version Updates¶
For manual releases, update:
pyproject.tomlversion field- Ensure version matches tag name
Quality Assurance¶
Pre-Release Checks¶
Automated Checks¶
- Unit tests pass
- Integration tests pass
- Code formatting validated
- Security scans pass
Manual Checks¶
- Test package installation
- Verify documentation builds
- Check release notes accuracy
Post-Release Verification¶
GitHub Release¶
- ✅ Correct tag and version
- ✅ Release notes generated
- ✅ Assets attached (.whl, .tar.gz)
PyPI Package¶
- ✅ Package uploaded successfully
- ✅ Metadata displays correctly
- ✅ Installation works
Documentation¶
- ✅ Versioned docs deployed
- ✅ Navigation functional
- ✅ Links work correctly
Troubleshooting¶
Common Issues¶
"File already exists" on PyPI¶
- Cause: Version already exists on PyPI
- Solution: Increment version number
Workflow doesn't trigger¶
- Cause: Tag format doesn't match pattern
- Solution: Ensure tag follows
v*format
Build failures¶
- Cause: pyproject.toml syntax errors
- Solution: Validate TOML syntax
PyPI upload failures¶
- Cause: Missing or invalid API token
- Solution: Check repository secrets
Debug Commands¶
# Validate pyproject.toml
python -c "import tomllib; tomllib.load(open('pyproject.toml', 'rb'))"
# Test package build
uv build
# Check package contents
uv run twine check dist/*
# Test installation
pip install --dry-run bank-statement-separator==2.0.2
Best Practices¶
Commit Message Guidelines¶
- Use conventional format for all commits
- Write clear descriptions of changes
- Reference issues when applicable
- Keep commits focused on single changes
Release Planning¶
- Plan release content in advance
- Test changes thoroughly before release
- Update documentation as needed
- Communicate changes to stakeholders
Version Strategy¶
- Use semantic versioning consistently
- Plan breaking changes carefully
- Document deprecations in advance
- Maintain backward compatibility when possible
Migration Guide¶
From Manual to Automated Releases¶
- Adopt conventional commits in development workflow
- Test automated process with feature branches
- Gradually reduce manual releases
- Monitor automated releases for quality
Repository Setup¶
Required secrets:
PYPI_API_TOKEN: For PyPI publishingOPENAI_API_KEY: For CI testing (optional)
Required permissions:
- Contents: write (for releases)
- Pull requests: write (for release-please)
Support¶
For release management issues:
- Check this documentation
- Review GitHub Actions logs
- Create issue in repository
- Contact development team
Quick Reference¶
Automated Release¶
Manual Release¶
# Update version
vim pyproject.toml
# Create tag
git tag -a v2.0.2 -m "Release v2.0.2"
# Push and trigger
git push origin v2.0.2
# Then use GitHub Actions UI