|
| 1 | +# Release Branch Strategy |
| 2 | + |
| 3 | +This document outlines the release branch strategy for semantic versioning and feature aggregation in the repos project. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Instead of creating individual releases for each feature or fix, we use release branches to aggregate multiple changes into a single semantic version release. This provides better control over releases and allows for more meaningful version increments. |
| 8 | + |
| 9 | +## Process |
| 10 | + |
| 11 | +### 1. Feature Development |
| 12 | + |
| 13 | +- Develop features and fixes on feature branches as usual |
| 14 | +- Merge approved changes to `main` branch |
| 15 | +- No releases are automatically created from `main` branch commits |
| 16 | + |
| 17 | +### 2. Release Preparation |
| 18 | + |
| 19 | +When ready to create a new release: |
| 20 | + |
| 21 | +1. **Create a release branch** from `main`: |
| 22 | + |
| 23 | + ```bash |
| 24 | + git checkout main |
| 25 | + git pull origin main |
| 26 | + git checkout -b release/1.2.0 |
| 27 | + ``` |
| 28 | + |
| 29 | +2. **Push the release branch**: |
| 30 | + |
| 31 | + ```bash |
| 32 | + git push -u origin release/1.2.0 |
| 33 | + ``` |
| 34 | + |
| 35 | +3. **Automatic release creation**: The GitHub Actions workflow will: |
| 36 | + - Analyze all commits since the last release |
| 37 | + - Determine the appropriate semantic version increment |
| 38 | + - Create a new release with aggregated changelog |
| 39 | + - Build and upload release artifacts |
| 40 | + |
| 41 | +### 3. Manual Release Trigger |
| 42 | + |
| 43 | +You can also manually trigger a release: |
| 44 | + |
| 45 | +1. Go to the **Actions** tab in GitHub |
| 46 | +2. Select the **Release** workflow |
| 47 | +3. Click **Run workflow** |
| 48 | +4. Optionally specify a release branch (defaults to `main`) |
| 49 | + |
| 50 | +## Semantic Versioning Rules |
| 51 | + |
| 52 | +The workflow analyzes commit messages to determine version increments: |
| 53 | + |
| 54 | +- **Major version** (1.0.0 → 2.0.0): Commits containing `BREAKING CHANGE:` in the body |
| 55 | +- **Minor version** (1.0.0 → 1.1.0): Commits with `feat:` prefix |
| 56 | +- **Patch version** (1.0.0 → 1.0.1): All other changes (fixes, docs, etc.) |
| 57 | + |
| 58 | +## Conventional Commits |
| 59 | + |
| 60 | +To ensure proper semantic versioning, use conventional commit format: |
| 61 | + |
| 62 | +```text |
| 63 | +<type>[optional scope]: <description> |
| 64 | +
|
| 65 | +[optional body] |
| 66 | +
|
| 67 | +[optional footer(s)] |
| 68 | +``` |
| 69 | + |
| 70 | +### Examples |
| 71 | + |
| 72 | +- **Feature**: `feat: add support for organization-wide repository listing` |
| 73 | +- **Fix**: `fix: handle rate limiting in GitHub API calls` |
| 74 | +- **Breaking change**: |
| 75 | + |
| 76 | + ```text |
| 77 | + feat: redesign configuration file format |
| 78 | +
|
| 79 | + BREAKING CHANGE: Configuration file format has changed from YAML to JSON. |
| 80 | + Users must migrate their existing config files. |
| 81 | + ``` |
| 82 | + |
| 83 | +## Branch Management |
| 84 | + |
| 85 | +- **`main`**: Latest development code, always deployable |
| 86 | +- **`release/*`**: Release preparation branches (e.g., `release/1.2.0`) |
| 87 | +- **Feature branches**: Individual feature development (merged to `main`) |
| 88 | + |
| 89 | +## Workflow Configuration |
| 90 | + |
| 91 | +The release workflow (`/.github/workflows/release.yml`) is configured with: |
| 92 | + |
| 93 | +- **`bump_each_commit: false`**: Only increment version once per release |
| 94 | +- **`search_commit_body: true`**: Look for breaking changes in commit bodies |
| 95 | +- **Release branch triggers**: Automatically trigger on `release/*` branches |
| 96 | +- **Manual dispatch**: Allow manual release creation |
| 97 | + |
| 98 | +## Benefits |
| 99 | + |
| 100 | +1. **Controlled releases**: Choose when to release and what to include |
| 101 | +2. **Meaningful versions**: Aggregate related changes into single releases |
| 102 | +3. **Better changelogs**: Comprehensive release notes for multiple features |
| 103 | +4. **Flexibility**: Manual and automatic release options |
| 104 | +5. **Semantic accuracy**: Proper version increments based on actual impact |
| 105 | + |
| 106 | +## Example Workflow |
| 107 | + |
| 108 | +```bash |
| 109 | +# Develop features |
| 110 | +git checkout -b feature/new-command |
| 111 | +# ... develop and test |
| 112 | +git checkout main |
| 113 | +git merge feature/new-command |
| 114 | + |
| 115 | +git checkout -b feature/ui-improvements |
| 116 | +# ... develop and test |
| 117 | +git checkout main |
| 118 | +git merge feature/ui-improvements |
| 119 | + |
| 120 | +# Ready to release |
| 121 | +git checkout -b release/1.3.0 |
| 122 | +git push -u origin release/1.3.0 |
| 123 | +# → GitHub Actions creates v1.3.0 release automatically |
| 124 | +``` |
| 125 | + |
| 126 | +This strategy ensures that releases are intentional, well-tested, and contain meaningful collections of changes rather than incremental updates for every small modification. |
0 commit comments