|
| 1 | +# Release Process with Release Please |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +ClickIt uses [Release Please](https://github.com/googleapis/release-please) to automate version management and releases. Release Please automatically: |
| 6 | + |
| 7 | +- 📝 Generates changelogs based on conventional commits |
| 8 | +- 🔢 Bumps version numbers in `ClickIt/Info.plist` |
| 9 | +- 🏷️ Creates git tags |
| 10 | +- 📦 Creates GitHub releases |
| 11 | +- 🔄 Updates `CHANGELOG.md` |
| 12 | + |
| 13 | +## How It Works |
| 14 | + |
| 15 | +### 1. Conventional Commits |
| 16 | + |
| 17 | +Use [Conventional Commits](https://www.conventionalcommits.org/) format for your commit messages: |
| 18 | + |
| 19 | +``` |
| 20 | +<type>(<scope>): <description> |
| 21 | +
|
| 22 | +[optional body] |
| 23 | +
|
| 24 | +[optional footer] |
| 25 | +``` |
| 26 | + |
| 27 | +**Types that trigger releases:** |
| 28 | +- `feat:` - New feature (bumps minor version) |
| 29 | +- `fix:` - Bug fix (bumps patch version) |
| 30 | +- `feat!:` or `fix!:` - Breaking change (bumps major version) |
| 31 | +- `perf:` - Performance improvement (bumps patch version) |
| 32 | + |
| 33 | +**Other types (included in changelog but don't trigger releases):** |
| 34 | +- `docs:` - Documentation changes |
| 35 | +- `refactor:` - Code refactoring |
| 36 | +- `test:` - Test updates |
| 37 | +- `chore:` - Maintenance tasks |
| 38 | +- `ci:` - CI/CD changes |
| 39 | +- `build:` - Build system changes |
| 40 | + |
| 41 | +**Examples:** |
| 42 | +```bash |
| 43 | +git commit -m "feat: add click interval presets" |
| 44 | +git commit -m "fix: correct emergency stop behavior" |
| 45 | +git commit -m "feat!: redesign UI with new navigation" |
| 46 | +git commit -m "perf: optimize click timing accuracy" |
| 47 | +``` |
| 48 | + |
| 49 | +### 2. Release Please Workflow |
| 50 | + |
| 51 | +When you push commits to `main`: |
| 52 | + |
| 53 | +1. **Release Please analyzes commits** since the last release |
| 54 | +2. **Creates/updates a Release PR** with: |
| 55 | + - Updated `CHANGELOG.md` |
| 56 | + - Bumped version in `ClickIt/Info.plist` |
| 57 | + - Updated `.release-please-manifest.json` |
| 58 | +3. **When you merge the Release PR:** |
| 59 | + - Creates a git tag (e.g., `v1.6.0`) |
| 60 | + - Creates a GitHub release with changelog |
| 61 | + - Triggers the build workflow to attach binaries |
| 62 | + |
| 63 | +### 3. Build Workflow |
| 64 | + |
| 65 | +The build workflow (`.github/workflows/release.yml`): |
| 66 | + |
| 67 | +1. Triggered by the tag created by Release Please |
| 68 | +2. Builds the universal macOS app bundle |
| 69 | +3. Creates `.zip` archive |
| 70 | +4. Uploads artifacts to the GitHub release |
| 71 | + |
| 72 | +## Creating a Release |
| 73 | + |
| 74 | +### Standard Release (Recommended) |
| 75 | + |
| 76 | +1. **Make changes using conventional commits:** |
| 77 | + ```bash |
| 78 | + git checkout -b feature/new-feature |
| 79 | + # Make changes |
| 80 | + git commit -m "feat: add new click pattern" |
| 81 | + git push origin feature/new-feature |
| 82 | + ``` |
| 83 | + |
| 84 | +2. **Create and merge PR to main:** |
| 85 | + - Open PR on GitHub |
| 86 | + - Get code review |
| 87 | + - Merge to `main` |
| 88 | + |
| 89 | +3. **Release Please creates a Release PR:** |
| 90 | + - Automatically created after merge to `main` |
| 91 | + - Reviews version bump and changelog |
| 92 | + - Title: "chore(main): release X.Y.Z" |
| 93 | + |
| 94 | +4. **Review and merge the Release PR:** |
| 95 | + - Check the version bump is correct |
| 96 | + - Review the generated changelog |
| 97 | + - Merge when ready to release |
| 98 | + |
| 99 | +5. **Automated release process:** |
| 100 | + - Tag created automatically |
| 101 | + - GitHub release created with changelog |
| 102 | + - Build workflow triggered |
| 103 | + - Binaries uploaded to release |
| 104 | + |
| 105 | +### Manual Release (Emergency) |
| 106 | + |
| 107 | +If you need to create a release manually: |
| 108 | + |
| 109 | +1. **Update version in Info.plist:** |
| 110 | + ```bash |
| 111 | + /usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString 1.6.0" ClickIt/Info.plist |
| 112 | + ``` |
| 113 | + |
| 114 | +2. **Update manifest:** |
| 115 | + ```bash |
| 116 | + echo '{ ".": "1.6.0" }' > .release-please-manifest.json |
| 117 | + ``` |
| 118 | + |
| 119 | +3. **Commit and tag:** |
| 120 | + ```bash |
| 121 | + git add ClickIt/Info.plist .release-please-manifest.json CHANGELOG.md |
| 122 | + git commit -m "chore: release 1.6.0" |
| 123 | + git tag v1.6.0 |
| 124 | + git push origin main |
| 125 | + git push origin v1.6.0 |
| 126 | + ``` |
| 127 | + |
| 128 | +## Version Bumping Rules |
| 129 | + |
| 130 | +Release Please determines version bumps based on commit types: |
| 131 | + |
| 132 | +| Commit Type | Version Bump | Example | |
| 133 | +|------------|--------------|---------| |
| 134 | +| `fix:` | Patch (1.5.5 → 1.5.6) | Bug fixes | |
| 135 | +| `feat:` | Minor (1.5.5 → 1.6.0) | New features | |
| 136 | +| `feat!:` or `fix!:` | Major (1.5.5 → 2.0.0) | Breaking changes | |
| 137 | +| `perf:` | Patch (1.5.5 → 1.5.6) | Performance | |
| 138 | + |
| 139 | +**Breaking Changes:** |
| 140 | +- Add `!` after type: `feat!:` or `fix!:` |
| 141 | +- Or add `BREAKING CHANGE:` in commit footer |
| 142 | + |
| 143 | +## Beta Releases |
| 144 | + |
| 145 | +Beta releases still use the manual tag approach: |
| 146 | + |
| 147 | +```bash |
| 148 | +git tag beta-v1.6.0-20250111 |
| 149 | +git push origin beta-v1.6.0-20250111 |
| 150 | +``` |
| 151 | + |
| 152 | +Beta releases trigger the `beta_release` job in `cicd.yml`. |
| 153 | + |
| 154 | +## Configuration Files |
| 155 | + |
| 156 | +- `.release-please-manifest.json` - Current version tracking |
| 157 | +- `release-please-config.json` - Release Please configuration |
| 158 | +- `CHANGELOG.md` - Auto-generated changelog |
| 159 | +- `ClickIt/Info.plist` - Version source of truth |
| 160 | + |
| 161 | +## Troubleshooting |
| 162 | + |
| 163 | +### Release PR not created |
| 164 | + |
| 165 | +- Check that commits follow conventional commit format |
| 166 | +- Ensure commits were pushed to `main` branch |
| 167 | +- Check GitHub Actions logs for release-please workflow |
| 168 | + |
| 169 | +### Wrong version bump |
| 170 | + |
| 171 | +- Review commit messages for types |
| 172 | +- Breaking changes need `!` or `BREAKING CHANGE:` footer |
| 173 | +- Manually edit the Release PR if needed |
| 174 | + |
| 175 | +### Build failed |
| 176 | + |
| 177 | +- Check release workflow logs in GitHub Actions |
| 178 | +- Verify Xcode version compatibility |
| 179 | +- Check build script: `build_app_unified.sh` |
| 180 | + |
| 181 | +## Migration from Manual Releases |
| 182 | + |
| 183 | +The old manual process (`scripts/update-version.sh`) is deprecated but still available for emergencies. The new process is: |
| 184 | + |
| 185 | +**Old:** Manual script → Manual tag → Release workflow |
| 186 | +**New:** Conventional commits → Release Please PR → Auto tag → Release workflow |
| 187 | + |
| 188 | +## Resources |
| 189 | + |
| 190 | +- [Release Please Documentation](https://github.com/googleapis/release-please) |
| 191 | +- [Conventional Commits Specification](https://www.conventionalcommits.org/) |
| 192 | +- [Semantic Versioning](https://semver.org/) |
0 commit comments