Version Bump Workflow
By Amr
Guide to the automated version bump workflow for managing semantic versioning and releases.
Estimated reading time: 3 minutes
Table of Contents
Version Bump Workflow
The Zer0-Mistakes theme includes an automated version bump workflow that handles semantic versioning, changelog updates, and release preparation.
Overview
The workflow supports two trigger modes:
- Manual: Select version type via GitHub Actions UI
- Automatic: Analyze commits to determine version bump type
Manual Version Bump
Using GitHub Actions UI
- Go to Actions tab in GitHub
- Select Version Bump workflow
- Click Run workflow
- Choose options:
- Version type:
patch,minor,major, orauto - Skip tests: Optional, for faster releases
- Dry run: Preview changes without committing
- Version type:
Using Command Line
# Bump patch version (bug fixes)
./scripts/version.sh patch
# Bump minor version (new features)
./scripts/version.sh minor
# Bump major version (breaking changes)
./scripts/version.sh major
# Push with tags
git push origin main --tags
Automatic Version Detection
When triggered by a push to main, the workflow analyzes commit messages:
| Commit Pattern | Version Bump |
|---|---|
BREAKING CHANGE: or !: |
Major |
feat: or feature: |
Minor |
fix:, docs:, chore: |
Patch |
Commit Message Examples
# Major bump (breaking change)
git commit -m "feat!: remove deprecated API endpoints"
git commit -m "refactor: new auth system
BREAKING CHANGE: authentication tokens now required"
# Minor bump (new feature)
git commit -m "feat: add dark mode toggle"
git commit -m "feature: implement search functionality"
# Patch bump (fix/maintenance)
git commit -m "fix: resolve navigation bug on mobile"
git commit -m "docs: update installation guide"
git commit -m "chore: update dependencies"
Workflow Configuration
Triggers
on:
push:
branches: [ main ]
paths-ignore:
- 'CHANGELOG.md'
- 'lib/jekyll-theme-zer0/version.rb'
- '*.gem'
workflow_dispatch:
inputs:
version_type:
type: choice
options: [patch, minor, major, auto]
Inputs
| Input | Description | Default |
|---|---|---|
version_type |
Type of version bump | patch |
skip_tests |
Skip test execution | false |
dry_run |
Preview changes only | false |
What the Workflow Does
1. Analyze Changes
- Determines appropriate version bump type
- Counts commits since last release
- Identifies breaking changes
2. Run Tests (Optional)
- Executes full test suite
- Validates Jekyll build
- Checks gem packaging
3. Bump Version
Updates version in:
lib/jekyll-theme-zer0/version.rbpackage.json
4. Update Changelog
- Extracts commit messages
- Categorizes changes (Added, Changed, Fixed)
- Updates
CHANGELOG.md
5. Create Release
- Commits version changes
- Creates git tag
- Triggers downstream release workflows
Workflow Outputs
| Output | Description |
|---|---|
bump_type |
Detected version bump type |
commit_count |
Number of commits analyzed |
should_release |
Whether release should proceed |
new_version |
New version number |
Best Practices
Commit Message Guidelines
Follow Conventional Commits:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, missing semicolonsrefactor: Code change (no feature/fix)test: Adding testschore: Maintenance
Breaking Changes
Indicate breaking changes with:
!after type:feat!: new API- Footer:
BREAKING CHANGE: description
Troubleshooting
Workflow Not Triggering
Check that commit doesn’t modify ignored paths:
CHANGELOG.mdlib/jekyll-theme-zer0/version.rb*.gem
Infinite Loop Prevention
The workflow skips if:
- Commit message contains
chore: bump version - Author is
github-actions
Version Already Exists
If version tag already exists:
- Delete the tag locally and remotely
- Re-run the workflow
git tag -d v1.2.3
git push origin :refs/tags/v1.2.3