Release Management Guide
This repository uses automated semantic versioning for releases. This document explains how the release system works and how to trigger releases.
How It Works
The release system automatically increments versions following Semantic Versioning principles:
- MAJOR version (e.g., 1.0.0 → 2.0.0): Breaking changes
- MINOR version (e.g., 1.0.0 → 1.1.0): New features, backwards compatible
- PATCH version (e.g., 1.0.0 → 1.0.1): Bug fixes, minor updates
Version Tracking
The current version is stored in version.json
at the repository root:
{
"version": "1.0.0",
"release_notes": "Release 1.0.0"
}
Triggering Releases
1. Automatic Releases (via Pull Requests)
When a Pull Request is merged to the main
branch, a release is automatically triggered based on PR labels:
PR Labels for Version Control
Add one of these labels to your PR to specify the version bump:
release:patch
- For bug fixes and minor updates (default if no label)release:minor
- For new features that are backwards compatiblerelease:major
- For breaking changes
Example:
# When creating a PR, add the appropriate label:
gh pr create --title "feat: Add new export format" --label "release:minor"
Breaking Changes Detection
If your PR contains breaking changes (indicated by !
in title or BREAKING CHANGE
in description), you MUST add the release:major
label, or the PR checks will fail.
2. Manual Releases (via GitHub Actions)
You can manually trigger a release from the GitHub Actions UI:
- Go to Actions → Automated Release
- Click Run workflow
- Select the version bump type:
patch
,minor
, ormajor
- Click Run workflow
3. Command Line Manual Release
Using GitHub CLI:
# Trigger a patch release
gh workflow run "Automated Release" --field version_bump=patch
# Trigger a minor release
gh workflow run "Automated Release" --field version_bump=minor
# Trigger a major release
gh workflow run "Automated Release" --field version_bump=major
Release Process
When a release is triggered, the system automatically:
- Calculates New Version: Based on current version and bump type
- Updates version.json: With the new version number
- Generates Release Notes: From commit messages since last release
- Creates Git Tag: In format
v1.0.0
- Creates GitHub Release: With generated notes and assets
- Uploads Assets: Source code archives (.tar.gz and .zip)
- Runs Tests: Validates the release works correctly
Release Notes
Release notes are automatically generated and include:
- What's Changed: List of commits since last release
- Changes by Type: Organized by conventional commit types (feat, fix, docs, etc.)
- Installation & Usage: Quick start guide
- Full Changelog: Link to compare view
Conventional Commit Messages
For better release notes, use conventional commit format:
feat: add new feature
fix: resolve bug
docs: update documentation
perf: improve performance
chore: maintenance tasks
Examples
Creating a Feature PR
# Create feature branch
git checkout -b feat/new-export-format
# Make changes and commit
git commit -m "feat: add JSON export format for compliance reports"
# Create PR with minor release label
gh pr create --title "feat: add JSON export format" --label "release:minor"
# When merged to main → triggers v1.1.0 release
Creating a Bug Fix PR
# Create fix branch
git checkout -b fix/excel-formatting
# Make changes and commit
git commit -m "fix: resolve Excel cell formatting issue"
# Create PR (patch is default)
gh pr create --title "fix: resolve Excel formatting issue"
# When merged to main → triggers v1.0.1 release
Creating a Breaking Change PR
# Create feature branch
git checkout -b feat/api-redesign
# Make breaking changes and commit
git commit -m "feat!: redesign CLI interface
BREAKING CHANGE: --input flag renamed to --file"
# Create PR with major release label
gh pr create --title "feat!: redesign CLI interface" --label "release:major"
# When merged to main → triggers v2.0.0 release
Release Assets
Each release includes:
- Source Code:
inventag-aws-v1.0.0.tar.gz
andinventag-aws-v1.0.0.zip
- Release Notes: Detailed changelog and installation instructions
- Git Tag:
v1.0.0
for version tracking
Monitoring Releases
- GitHub Releases: https://github.com/[owner]/[repo]/releases
- Actions Logs: Monitor release progress in GitHub Actions
- Version File: Check
version.json
for current version
Troubleshooting
Common Issues
-
Release Not Triggered
- Ensure PR is merged to
main
branch - Check for proper PR labels
- Verify GitHub Actions are enabled
- Ensure PR is merged to
-
Version Calculation Errors
- Check
version.json
format is valid - Ensure semver dependency is installed
- Check
-
Permission Errors
- Verify repository has proper GitHub token permissions
- Check that Actions have
contents: write
permission
Manual Recovery
If a release fails, you can:
- Check the Actions logs for specific errors
- Fix any issues and re-run the workflow
- Manually create releases if needed using GitHub UI
Best Practices
- Use Descriptive Commit Messages: Helps generate better release notes
- Test Before Merging: Ensure all tests pass
- Label PRs Appropriately: Use correct version bump labels
- Review Breaking Changes: Carefully consider major version bumps
- Monitor Releases: Check that releases complete successfully
For questions or issues with the release system, please check the GitHub Actions logs or create an issue.