Skip to content

Commit 01573ba

Browse files
Update main branch with next SNAPSHOT version after release
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
1 parent 11dbea2 commit 01573ba

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,28 @@ jobs:
160160
161161
echo "Pushed release branch: $RELEASE_BRANCH"
162162
163+
- name: Update main branch with next development version
164+
run: |
165+
NEXT_VERSION="${{ steps.validate_tag.outputs.next_version }}"
166+
167+
echo "Updating main branch to next development version: $NEXT_VERSION"
168+
169+
# Fetch and checkout main branch
170+
git fetch origin main
171+
git checkout main
172+
173+
# Update to next SNAPSHOT version
174+
./mvnw -B versions:set -DnewVersion="${NEXT_VERSION}" -DgenerateBackupPoms=false
175+
176+
# Commit the version change
177+
git add .
178+
git commit -m "[maven-release-plugin] prepare for next development iteration"
179+
180+
# Push to main
181+
git push origin main
182+
183+
echo "Updated main branch to version: $NEXT_VERSION"
184+
163185
- name: Clean up
164186
if: always()
165187
run: |

RELEASING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ Once you publish the release, the "Automated Release" workflow will:
4343
- Javadoc JARs
4444
- GPG signatures
4545
8. ✅ Update the release tag to point to the release commit
46-
9. ✅ Update `pom.xml` files to the next SNAPSHOT version
46+
9. ✅ Update `pom.xml` files to the next SNAPSHOT version on release branch
4747
10. ✅ Push all commits to the release branch
48+
11. ✅ Update `main` branch with the next SNAPSHOT version
4849

4950
**Workflow Diagram:**
5051
```
@@ -68,9 +69,12 @@ Workflow: Update pom.xml to 1.2.1-SNAPSHOT → commit C
6869
6970
Workflow: Push branch release-1.2.0
7071
72+
Workflow: Update main branch → pom.xml to 1.2.1-SNAPSHOT
73+
7174
Result:
7275
- Tag v1.2.0 → commit B (release version)
7376
- Branch release-1.2.0 → commit C (next SNAPSHOT)
77+
- Main branch → updated to 1.2.1-SNAPSHOT
7478
- Artifacts deployed to Maven Central
7579
```
7680

@@ -83,10 +87,12 @@ Result:
8387
## Release Branch Strategy
8488

8589
- **Main branch (`main`)**: Contains development code with `-SNAPSHOT` versions
90+
- Automatically updated to next SNAPSHOT version after each release
8691
- **Release branches (`release-X.Y.Z`)**: Created automatically for each release
8792
- Contains two commits:
8893
1. Version update to release version (X.Y.Z)
8994
2. Version update to next development version (X.Y.Z+1-SNAPSHOT)
95+
- The next development version commit is also applied to `main`
9096
- **Release tags (`vX.Y.Z`)**: Points to the release version commit
9197

9298
## Version Numbering

0 commit comments

Comments
 (0)