Skip to content

Commit 779893c

Browse files
committed
RELEASE.md: recommend release branch instead of release from main
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
1 parent 20ea31b commit 779893c

1 file changed

Lines changed: 26 additions & 12 deletions

File tree

‎RELEASE.md‎

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@
44

55
Instructions for a new major, new minor, or a patch when this would make it the latest version (e.g. 2.2.1 when latest version is 2.2.0)
66

7-
Ensure you have the latest changes locally, and no uncommitted changes:
7+
Set the version locally:
88

99
```shell
10-
git pull --ff-only
11-
git status
10+
export RELEASE_VERSION=2.2.0
11+
export NEXT_VERSION=2.2.1-SNAPSHOT
12+
export RELEASE_BRANCH="release/${RELEASE_VERSION}"
1213
```
1314

14-
Set the version locally:
15+
Ensure you have the latest changes locally, and no uncommitted changes.
16+
Then create a release branch.
1517

1618
```shell
17-
export RELEASE_VERSION=2.2.0
18-
export NEXT_VERSION=2.2.1-SNAPSHOT
19+
git switch main
20+
git pull --ff-only
21+
git status
22+
git switch --create "$RELEASE_BRANCH"
1923
```
2024

2125
Update the versions:
@@ -51,19 +55,29 @@ git tag --annotate "v$RELEASE_VERSION" --message "Release version $RELEASE_VERSI
5155
Review the commit and the tag (`git show "v$RELEASE_VERSION"`), then push it and release the
5256
version.
5357

54-
> ⚠️ Take a good review before pushing!
58+
> ⚠️ Take a good review before pushing, and make sure the versions are correct.
5559
5660
Push:
5761

5862
```shell
59-
git push --tags origin HEAD
63+
git push --tags --set-upstream origin HEAD
6064
```
6165

6266
Then release from the "[Release to Maven Central](https://github.com/modelcontextprotocol/java-sdk/actions/workflows/maven-central-release.yml)" action. Click "Run workflow", choose the newly pushed tag, then "run workflow".
63-
Wait for the release to be done before updating the "next version". In case anything goes wrong, you
64-
can "add" to the release and update the tag.
6567

66-
Once the release is done, update to the next version, review the commit, and push:
68+
> ⚠️ Wait for the release to succeed before moving forward. You can still make changes on the
69+
> release branch before merging to main, in case anything goes wrong.
70+
71+
Once the release is done, you can merge your changes back into main:
72+
73+
```shell
74+
git switch main
75+
git merge --ff-only "$RELEASE_BRANCH"
76+
git push
77+
git push --delete origin "$RELEASE_BRANCH"
78+
```
79+
80+
Then update to the next version:
6781

6882
```shell
6983
# Update version in pom
@@ -76,7 +90,7 @@ git commit --signoff --message "Next development version"
7690
Review the commit (`git show`). Push:
7791

7892
```shell
79-
git push origin HEAD
93+
git push
8094
```
8195

8296
Lastly, create release notes.

0 commit comments

Comments
 (0)