This document describes the improved release process that separates versioning from releasing for better control and review.
-
GitHub CLI: Install and authenticate with GitHub CLI
brew install gh gh auth login
-
Verify Setup: Check that everything is configured correctly
make gh-status
The release process is now separated into two distinct steps for better control:
Choose the appropriate version bump based on your changes:
# For bug fixes and patches
make version-patch # 0.2.1 → 0.2.2
# For new features (backward compatible)
make version-minor # 0.2.1 → 0.3.0
# For breaking changes
make version-major # 0.2.1 → 1.0.0This will:
- Update version numbers in code
- Update
CHANGELOG.mdwith new version entry - Create git commit and tag locally
- Give you next steps
After version bumping, you have options:
Option A: Create Draft Release (Recommended)
make release-draftThis creates a draft release on GitHub that you can review and edit before publishing.
Option B: Direct Release
make releaseThis immediately creates and publishes the release.
Option C: Manual Review
- Edit
CHANGELOG.mdto add proper release notes - Review the changes
- Then run
make releasewhen ready
- Runs quality checks
- Updates version in
pyproject.tomlanddateutils/__init__.py - Updates
CHANGELOG.mdwith new version entry (with placeholders) - Creates git commit with version bump message
- Creates git tag locally
- Does NOT push or release anything
- Verifies you've run a version command first
- Checks that the version isn't already released on GitHub
- Runs comprehensive quality checks
- Builds distribution packages
- Pushes commits and tags to GitHub
- Creates GitHub release with release notes
- Uploads distribution files
- Same as release but creates a draft
- Allows you to review before publishing
- Can be updated/recreated if needed
- Prevents double releases:
make releasewill fail gracefully if the version is already released - Requires versioning first:
make releasewill fail if no version tag exists locally - Quality gates: All commands run comprehensive checks before proceeding
- Rollback friendly: Version bumps are local until you run release commands
# 1. Make your code changes
# ... edit code, add tests, etc ...
# 2. Run quality checks
make check
# 3. Bump version and prepare release
make version-patch
# 4. Review and edit the changelog
# Edit CHANGELOG.md - add proper descriptions under the new version section
# 5. Create draft release for review (optional)
make release-draft
# 6. Review the draft on GitHub, then either:
# - Edit the draft on GitHub and publish manually, OR
# - Run the final release command:
make releaseThe old combined commands still work but are deprecated:
make release-patch # Still works, but shows deprecation warning
make release-minor # Still works, but shows deprecation warning
make release-major # Still works, but shows deprecation warningThese run version-* followed by release in sequence.
Release notes are automatically generated from:
- Release Template (
.github/RELEASE_TEMPLATE.md): Used as base if present - Changelog Extraction: Relevant sections from
CHANGELOG.mdare automatically included - Fallback: Auto-generated notes with links to changelog
make test-release-notesmake check-release-existsmake create-github-release VERSION=x.y.zmake update-changelog VERSION=x.y.z# Delete the existing release if you need to recreate it
gh release delete vX.Y.Z
make releaseThis means you haven't run a version command first:
make version-patch # or version-minor/major
make releaseSince version bumping and releasing are separate, you can retry releases:
# Fix any issues, then retry
make release# Check authentication
make gh-status
# Re-authenticate if needed
gh auth loginThe repository includes GitHub Actions that automatically:
- Run tests when tags are pushed
- Publish to PyPI after successful release
The Makefile integrates with this by ensuring proper tags and releases are created.
If you were using the old workflow, simply switch to:
Old:
make release-patchNew:
make version-patch
# Review CHANGELOG.md
make releaseThe new workflow gives you more control and the ability to review changes before publishing.