|
| 1 | +# Patch Release Process (MICRO Version Increase) |
| 2 | + |
| 3 | +This section describes the process for creating a patch release (MICRO version increase), such as releasing 7.2.1 after 7.2.0 has already been released. |
| 4 | + |
| 5 | +## When to Use Patch Releases |
| 6 | + |
| 7 | +Patch releases are used when: |
| 8 | +- The previous MINOR version (e.g., 7.2.0) has already been released and published to Maven Central |
| 9 | +- Critical bug fixes or security patches need to be released without introducing new features |
| 10 | +- The fixes are cherry-picked from the `master` branch to the `next` branch |
| 11 | + |
| 12 | +## Key Differences from Regular Releases |
| 13 | + |
| 14 | +Patch releases differ from regular MINOR version releases in several important ways: |
| 15 | + |
| 16 | +1. **Master branch is NOT updated** - The `master` branch continues with its current development version (e.g., 7.3.0-SNAPSHOT) |
| 17 | +2. **First RC builds with previous release** - The first patch RC (RC1) builds using the previous final release version (e.g., 7.2.0 for 7.2.1-RC1) |
| 18 | +3. **Subsequent RCs build with previous RC** - RC2 and later build using the RC version range (e.g., [7.2.1-RC,7.3.0)) |
| 19 | +4. **About.java gets a patch version constant** - A constant like `_7_2_1` is added (with three components, not two) |
| 20 | + |
| 21 | +## Preparation for First Patch Release Candidate |
| 22 | + |
| 23 | +The `next` branch should still be on the previous release version (e.g., 7.2.0). Make sure to cherry-pick the necessary fixes from `master` to `next`. |
| 24 | + |
| 25 | +```bash |
| 26 | +git checkout next |
| 27 | +git cherry-pick <commit-sha>... |
| 28 | +``` |
| 29 | + |
| 30 | +Execute the `release.sh` script with the `patch-first-rc` mode: |
| 31 | + |
| 32 | +```bash |
| 33 | +# Prepare next branch for 7.2.1-RC1 (assuming 7.2.0 was previously released) |
| 34 | +.github/scripts/release.sh --mode patch-first-rc --release-version 7.2.1 --next-version 7.3.0 --rc 1 |
| 35 | +``` |
| 36 | + |
| 37 | +### What the Script Does for patch-first-rc |
| 38 | + |
| 39 | +The script will make the following changes: |
| 40 | + |
| 41 | +1. **Update `gradle.properties` (root)**: Set `bnd_version=[7.2.0,7.3.0)` |
| 42 | + - This uses the previous final release (7.2.0), NOT the RC range |
| 43 | + - This is because RC1 doesn't exist yet in any repository |
| 44 | + |
| 45 | +2. **Update `cnf/build.bnd`**: |
| 46 | + - Set `base.version: 7.2.1` |
| 47 | + - Uncomment and set `-snapshot: RC1` |
| 48 | + |
| 49 | +3. **Update `biz.aQute.bndlib/src/aQute/bnd/osgi/About.java`**: |
| 50 | + - Add new version constant: `public static final Version _7_2_1 = new Version(7, 2, 1);` |
| 51 | + - Update `CURRENT` to point to `_7_2_1` |
| 52 | + - Add `CHANGES_7_2_1` constant with link to changes wiki page |
| 53 | + - Add entry to CHANGES map |
| 54 | + |
| 55 | +4. **Update `biz.aQute.bndlib/src/aQute/bnd/osgi/package-info.java`**: Set `@Version("7.2.1")` |
| 56 | + |
| 57 | +5. **Update `maven-plugins/bnd-plugin-parent/pom.xml`**: Set `<revision>7.2.1-RC1</revision>` |
| 58 | + |
| 59 | +6. **Update `gradle-plugins/gradle.properties`**: Set `bnd_version: 7.2.1-RC1` |
| 60 | + |
| 61 | +7. **Update `gradle-plugins/README.md`**: Replace version references from 7.3.0 to 7.2.1 |
| 62 | + |
| 63 | +8. **Create `biz.aQute.bndlib/src/aQute/bnd/build/7.2.1.bnd`** with version defaults |
| 64 | + |
| 65 | +### Next Steps After patch-first-rc |
| 66 | + |
| 67 | +Follow the output instructions: |
| 68 | + |
| 69 | +```bash |
| 70 | +# Review changes |
| 71 | +git diff |
| 72 | + |
| 73 | +# Commit |
| 74 | +git add . && git commit -m 'build: Build Release 7.2.1.RC1' |
| 75 | + |
| 76 | +# Tag |
| 77 | +git tag -s 7.2.1.RC1 |
| 78 | + |
| 79 | +# Push (force push to update next branch) |
| 80 | +git push --force origin next 7.2.1.RC1 |
| 81 | +``` |
| 82 | + |
| 83 | +After pushing: |
| 84 | +- Update JFROG manually (see main release process documentation) |
| 85 | +- The [update-rc](https://bndtools.jfrog.io/ui/admin/repositories/virtual/update-rc/edit) P2 repository must be changed to point to the RC P2 artifact |
| 86 | +- Set **Local Repository** to `libs-release-local` and **Path Suffix** to `org/bndtools/org.bndtools.p2/7.2.1-RC1/org.bndtools.p2-7.2.1-RC1.jar!` |
| 87 | + |
| 88 | +## Subsequent Patch Release Candidates (RC2, RC3, ...) |
| 89 | + |
| 90 | +When additional fixes need to be included, cherry-pick them from `master` to `next` and create a new RC: |
| 91 | + |
| 92 | +```bash |
| 93 | +git checkout next |
| 94 | +git cherry-pick <commit-sha>... |
| 95 | +``` |
| 96 | + |
| 97 | +Execute the `release.sh` script with the `patch-next-rc` mode: |
| 98 | + |
| 99 | +```bash |
| 100 | +# Update to 7.2.1-RC2 |
| 101 | +.github/scripts/release.sh --mode patch-next-rc --release-version 7.2.1 --next-version 7.3.0 --rc 2 |
| 102 | +``` |
| 103 | + |
| 104 | +### What the Script Does for patch-next-rc |
| 105 | + |
| 106 | +The script will make the following changes: |
| 107 | + |
| 108 | +1. **Update `gradle.properties` (root)**: Set `bnd_version=[7.2.1-RC,7.3.0)` |
| 109 | + - This now uses the RC range to pick up previous RCs (7.2.1-RC1) |
| 110 | + - This is the key difference from RC1 |
| 111 | + |
| 112 | +2. **Update `cnf/build.bnd`**: Set `-snapshot: RC2` |
| 113 | + |
| 114 | +3. **Update `maven-plugins/bnd-plugin-parent/pom.xml`**: Set `<revision>7.2.1-RC2</revision>` |
| 115 | + |
| 116 | +4. **Update `gradle-plugins/gradle.properties`**: Set `bnd_version: 7.2.1-RC2` |
| 117 | + |
| 118 | +### Next Steps After patch-next-rc |
| 119 | + |
| 120 | +Follow the output instructions: |
| 121 | + |
| 122 | +```bash |
| 123 | +# Review changes |
| 124 | +git diff |
| 125 | + |
| 126 | +# Commit |
| 127 | +git add . && git commit -m 'build: Build Release 7.2.1.RC2' |
| 128 | + |
| 129 | +# Tag |
| 130 | +git tag -s 7.2.1.RC2 |
| 131 | + |
| 132 | +# Push |
| 133 | +git push origin next 7.2.1.RC2 |
| 134 | +``` |
| 135 | + |
| 136 | +After pushing: |
| 137 | +- Update JFROG for the build |
| 138 | +- The [update-rc](https://bndtools.jfrog.io/bndtools/update-rc/) P2 repository must be changed to point to the new RC P2 artifact |
| 139 | +- Update **Path Suffix** to `org/bndtools/org.bndtools.p2/7.2.1-RC2/org.bndtools.p2-7.2.1-RC2.jar!` |
| 140 | +- Make sure NOT to remove the previous 7.2.1 RC releases from the virtual repository configuration |
| 141 | + |
| 142 | +## Final Patch Release |
| 143 | + |
| 144 | +Once the last RC has been approved, use the regular `release` mode: |
| 145 | + |
| 146 | +```bash |
| 147 | +# Final release of 7.2.1 |
| 148 | +.github/scripts/release.sh --mode release --release-version 7.2.1 |
| 149 | +``` |
| 150 | + |
| 151 | +This is identical to the final release process for regular releases. See the main [Release Process](https://github.com/bndtools/bnd/wiki/Release-Process#release) documentation for the complete steps. |
| 152 | + |
| 153 | +## Summary: Patch Release Workflow |
| 154 | + |
| 155 | +Here's a complete example workflow for releasing 7.2.1 as a patch to 7.2.0: |
| 156 | + |
| 157 | +```bash |
| 158 | +# Assuming 7.2.0 was already released, and next branch is on 7.2.0 |
| 159 | +git checkout next |
| 160 | + |
| 161 | +# Cherry-pick fixes from master |
| 162 | +git cherry-pick <fix1-sha> <fix2-sha> ... |
| 163 | + |
| 164 | +# Prepare first patch RC |
| 165 | +.github/scripts/release.sh --mode patch-first-rc --release-version 7.2.1 --next-version 7.3.0 --rc 1 |
| 166 | +git add . && git commit -m 'build: Build Release 7.2.1.RC1' |
| 167 | +git tag -s 7.2.1.RC1 |
| 168 | +git push --force origin next 7.2.1.RC1 |
| 169 | +# Update JFROG manually |
| 170 | + |
| 171 | +# If more fixes needed, prepare RC2 |
| 172 | +git cherry-pick <fix3-sha> ... |
| 173 | +.github/scripts/release.sh --mode patch-next-rc --release-version 7.2.1 --next-version 7.3.0 --rc 2 |
| 174 | +git add . && git commit -m 'build: Build Release 7.2.1.RC2' |
| 175 | +git tag -s 7.2.1.RC2 |
| 176 | +git push origin next 7.2.1.RC2 |
| 177 | +# Update JFROG manually |
| 178 | + |
| 179 | +# Final release |
| 180 | +.github/scripts/release.sh --mode release --release-version 7.2.1 |
| 181 | +git add . && git commit -m 'build: Build Release 7.2.1' |
| 182 | +git tag -s 7.2.1 |
| 183 | +git push origin next 7.2.1 |
| 184 | +# Follow post-release steps (Maven Central, GitHub Release, etc.) |
| 185 | +``` |
| 186 | + |
| 187 | +## Important Notes |
| 188 | + |
| 189 | +1. **Master branch is NOT touched** - Unlike regular releases, patch releases do not update the `master` branch at all. The `master` branch continues with the next development version (e.g., 7.3.0-SNAPSHOT). |
| 190 | + |
| 191 | +2. **RC1 uses base version** - The first patch RC builds with the previous final release version (e.g., `bnd_version=[7.2.0,7.3.0)`) because the RC doesn't exist yet. |
| 192 | + |
| 193 | +3. **RC2+ uses RC range** - Subsequent patch RCs use the RC version range (e.g., `bnd_version=[7.2.1-RC,7.3.0)`) to pick up previous RCs. |
| 194 | + |
| 195 | +4. **About.java patch constant** - The patch version constant includes all three components (e.g., `_7_2_1`), unlike regular releases which only use two (e.g., `_7_2`). |
| 196 | + |
| 197 | +5. **Wiki page** - Create a new wiki page for the patch release: `Changes-in-7.2.1` |
| 198 | + |
| 199 | +6. **Post-release process** - The post-release process (Maven Central, GitHub Release, JFROG updates, etc.) is the same as for regular releases. |
0 commit comments