Release Automation System¶
Version: 2.0 (Modular Architecture)
Status: ✅ Production-Ready
Last Updated: 2025-11-25
Modernization: Completed (Phases 1-3)
Overview¶
The Zer0-Mistakes release automation system provides comprehensive, modular automation for semantic versioning, changelog generation, gem building, and publishing. The system was fully modernized in November 2025, transitioning from monolithic scripts to a modular, testable architecture.
Quick Start¶
Installation Requirements¶
System Requirements:
- Bash 3.2+ (macOS default is supported — no Homebrew Bash required)
- Docker 20.10+ (for development)
- Git 2.30+
- Ruby 3.0+ (optional with Docker)
- RubyGems Account (for publishing)
Basic Usage¶
# Preview release
bash scripts/release patch --dry-run
# Build and test (no publish)
scripts/release patch --skip-publish --no-github-release
# Full release
bash scripts/release patch
VS Code Integration¶
Press Cmd+Shift+P → "Tasks: Run Task" → Choose:
- 🚀 Release: Patch/Minor/Major
- 🔍 Release: Dry Run Preview
- ⚡ Release: Quick Build & Test
- 🔨 Build: Gem Only
Architecture¶
Modular Library System¶
The release automation is built on 6 focused libraries:
scripts/lib/
├── common.sh (165 lines) - Logging, error handling, utilities
├── validation.sh (120 lines) - Environment validation
├── version.sh (155 lines) - Version management
├── git.sh (165 lines) - Git operations
├── changelog.sh (230 lines) - Changelog generation
└── gem.sh (160 lines) - Gem build/publish
Total: 995 lines of modular, testable code
Command Interface¶
Two simplified commands provide the user interface:
scripts/
├── release (200 lines) - Complete release workflow
├── build (80 lines) - Gem building only
├── gem-publish.sh - Deprecation wrapper → release
├── release.sh - Deprecation wrapper → release
└── build.sh - Deprecation wrapper → build
Benefits:
- 76% reduction in user-facing code complexity
- Single responsibility per library
- Comprehensive test coverage (63+ assertions)
- Easy to extend and maintain
Release Workflow¶
10-Step Process¶
The scripts/release command executes:
- Validate Environment - Git status, dependencies, credentials
- Calculate New Version - Semantic version bump
- Generate Changelog - From conventional commits
- Update Version Files - version.rb, package.json
- Run Test Suite - Validate changes
- Build Gem - Create .gem package
- Commit and Tag - Version bump commit
- Publish to RubyGems - Public gem release
- Create GitHub Release - With release notes
- Push Changes - Tags and commits to remote
Command Options¶
# Version Types
scripts/release patch # 0.6.0 → 0.6.1
scripts/release minor # 0.6.0 → 0.7.0
scripts/release major # 0.6.0 → 1.0.0
# Control Options
--dry-run # Preview without changes
--skip-tests # Skip test execution
--skip-publish # Skip RubyGems publishing
--no-github-release # Skip GitHub release
--non-interactive # No confirmation prompts
--help # Show usage information
Example Workflows¶
Development Testing:
# 1. Preview changes
bash scripts/release patch --dry-run
# 2. Build and test locally
scripts/release patch --skip-publish --no-github-release
# 3. If all good, do full release
bash scripts/release patch
Quick Gem Build:
# Build gem without release workflow
./scripts/build
# Preview build steps
./scripts/build --dry-run
CI/CD Pipeline:
Changelog Generation¶
Conventional Commits¶
The system automatically generates changelogs from conventional commit messages:
Commit Format:
Supported Types:
feat:→ Added sectionfix:→ Fixed sectionrefactor:→ Changed sectiondocs:→ Changed sectionperf:→ Changed sectiontest:→ Other sectionchore:→ Other sectionBREAKING CHANGE:→ Breaking Changes section
Example Commits:
feat: add responsive navigation component
fix: resolve sidebar collapse issue on mobile
docs: update installation instructions
refactor: simplify version calculation logic
Automatic Filtering¶
The changelog generator automatically excludes:
- Merge commits
- Version bump commits (
chore: bump version) - Commits only touching version/changelog files
- Automated release commits
Testing¶
Test Suite¶
Comprehensive test coverage with 63+ assertions:
# Run all tests
./scripts/test/lib/run_tests.sh
# Test specific library
./scripts/test/lib/test_version.sh
./scripts/test/lib/test_changelog.sh
./scripts/test/lib/test_git.sh
Test Coverage:
- Version calculation (20+ assertions)
- Changelog generation (15+ assertions)
- Validation checks (10+ assertions)
- Git operations (10+ assertions)
- Gem operations (8+ assertions)
Manual Testing¶
# Test environment validation
./scripts/release --help
# Test build system
./scripts/build --dry-run
# Test full workflow (safe)
bash scripts/release patch --dry-run --non-interactive
Troubleshooting¶
Common Issues¶
Bash Not Found:
Solution:
Install Bash via your system package manager (e.g., sudo apt install bash on Debian/Ubuntu) or use the system-provided Bash which is available by default on macOS and Linux.
Working Directory Not Clean:
Solution:
git status # Review changes
git add . && git commit -m "..." # Commit changes
# or
git stash # Stash temporarily
RubyGems Authentication:
Solution:
For comprehensive troubleshooting, see: Troubleshooting
Migration Guide¶
For Contributors¶
Old Commands:
New Commands:
For CI/CD Pipelines¶
Update GitHub Actions:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Release
run: bash scripts/release patch --non-interactive
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
Performance¶
Expected Timing¶
| Step | Duration |
|---|---|
| Validation | 2-5 seconds |
| Version calculation | <1 second |
| Changelog generation | 5-30 seconds |
| Version updates | 1-2 seconds |
| Test suite | 10-60 seconds |
| Gem build | 5-15 seconds |
| RubyGems publish | 10-30 seconds |
| GitHub release | 5-10 seconds |
| Push changes | 2-5 seconds |
Total: 2-5 minutes for complete release
Known Issues¶
Changelog Generation (Non-Blocking)¶
Issue: Changelog generation may exit prematurely during commit processing loop.
Impact: Changelog automation incomplete
Workaround:
- Use
scripts/buildfor gem building - Manual changelog updates remain supported
- Doesn't block other functionality
Status: Documented, tracked for v0.7.0
Development¶
Adding New Functionality¶
- Identify appropriate library (
scripts/lib/) - Add function following existing patterns
- Write tests in corresponding test file
- Update library README with documentation
- Test locally before committing
Example:
# Add function to scripts/lib/version.sh
validate_version_format() {
local version="$1"
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
}
# Add test to scripts/test/lib/test_version.sh
test_validate_version_format() {
assert_success validate_version_format "1.2.3"
assert_failure validate_version_format "1.2"
}
Library Documentation¶
Each library includes:
- Purpose and scope
- Exported functions
- Usage examples
- Dependencies
- Testing instructions
Modernization History¶
Project Timeline¶
Phase 1: Library Extraction (Completed 2025-11-25)
- Created 6 modular libraries from monolithic scripts
- Built comprehensive test suite (63+ assertions)
- Established single responsibility architecture
Phase 2: Simplified Commands (Completed 2025-11-25)
- Created
scripts/releaseandscripts/buildcommands - Added deprecation wrappers for backward compatibility
- Updated 8 VS Code tasks
- Achieved 76% code reduction
Phase 3: Documentation & Testing (Completed 2025-11-25)
- Updated CONTRIBUTING.md and README.md
- Created 700-line TROUBLESHOOTING guide
- Validated complete system functionality
- Provided migration guidance
Impact Metrics¶
Code Quality:
- Before: 1,170+ lines in 3 monolithic scripts
- After: 1,375 lines in modular libraries + 280 lines in commands
- Reduction: 76% fewer lines in user-facing code
- Documentation: 2,110+ lines of guides
Testing:
- Test coverage: 63+ assertions
- All core functions tested
- Dry-run mode validated
- Error handling comprehensive
Developer Experience:
- Setup time: <5 minutes
- Built-in help system
- 8 VS Code tasks
- 700-line troubleshooting guide
Related Documentation¶
Internal Documentation¶
- Library README - Detailed library documentation
- Troubleshooting - Common issues and solutions
- CONTRIBUTING - Development guidelines
- Test Suite - Testing documentation
Historical Documentation¶
- Modernization completed November 2025
- Phase documentation archived
- All functionality integrated into this guide
External Resources¶
- Semantic Versioning - Version numbering standard
- Conventional Commits - Commit message format
- RubyGems Publishing - Gem publication guide
Support¶
Getting Help¶
- Check TROUBLESHOOTING.md - Most issues covered
- Run with --help - See all options
- Try dry-run mode - Test safely
- Read error messages - Often include solutions
Reporting Issues¶
Open an issue at: https://github.com/bamr87/zer0-mistakes/issues/new
Include:
- Bash version (
bash --version) - Command run (with options)
- Full error output
- Git status (
git status) - Environment (macOS/Linux/WSL)
Last Updated: 2025-11-25
System Version: 2.0 (Modular Architecture)
Status: Production-Ready
Maintainer: bamr87