Skip to content

Commit ed57bb6

Browse files
committed
Update release notes to reflect new branch namings
1 parent 7880990 commit ed57bb6

File tree

1 file changed

+20
-81
lines changed

1 file changed

+20
-81
lines changed

RELEASING.md

Lines changed: 20 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Releasing
22

3-
The following steps outline the release process for both new minor versions (e.g.
4-
releasing the `master` branch as X.Y.0) and patch versions (e.g. releasing the
5-
`vX.Y` branch as X.Y.Z).
3+
The following steps outline the release process for both new minor versions and
4+
patch versions.
65

76
The command examples below assume that the canonical "mongodb" repository has
87
the remote name "mongodb". You may need to adjust these commands if you've given
@@ -37,26 +36,10 @@ page.
3736
This uses [semantic versioning](https://semver.org/). Do not break
3837
backwards compatibility in a non-major release or your users will kill you.
3938

40-
Before proceeding, ensure that the `master` branch is up-to-date with all code
39+
Before proceeding, ensure that the default branch is up-to-date with all code
4140
changes in this maintenance branch. This is important because we will later
42-
merge the ensuing release commits up to master with `--strategy=ours`, which
43-
will ignore changes from the merged commits.
44-
45-
## Update composer.json
46-
47-
This is especially important before releasing a new minor version.
48-
49-
Ensure that the extension and PHP library requirements, as well as the branch
50-
alias in `composer.json` are correct for the version being released. For
51-
example, the branch alias for the 4.1.0 release in the `master` branch should
52-
be `4.1.x-dev`.
53-
54-
Commit and push any changes:
55-
56-
```console
57-
$ git commit -m "Update composer.json X.Y.Z" composer.json
58-
$ git push mongodb
59-
```
41+
merge the ensuing release commits with `--strategy=ours`, which will ignore
42+
changes from the merged commits.
6043

6144
## Tag the release
6245

@@ -69,78 +52,34 @@ $ git push mongodb --tags
6952

7053
## Branch management
7154

72-
# Creating a maintenance branch and updating master branch alias
73-
74-
After releasing a new major or minor version (e.g. 4.0.0), a maintenance branch
75-
(e.g. v4.0) should be created. Any development towards a patch release (e.g.
76-
4.0.1) would then be done within that branch and any development for the next
77-
major or minor release can continue in master.
78-
79-
After creating a maintenance branch, the `extra.branch-alias.dev-master` field
80-
in the master branch's `composer.json` file should be updated. For example,
81-
after branching v4.0, `composer.json` in the master branch may still read:
82-
83-
```
84-
"branch-alias": {
85-
"dev-master": "4.0.x-dev"
86-
}
87-
```
88-
89-
The above would be changed to:
90-
91-
```
92-
"branch-alias": {
93-
"dev-master": "4.1.x-dev"
94-
}
95-
```
96-
97-
Commit this change:
98-
99-
```console
100-
$ git commit -m "Master is now 4.1-dev" composer.json
101-
```
55+
# Creating a maintenance branch and updating default branch name
10256

103-
### After releasing a new minor version
104-
105-
After a new minor version is released (i.e. `master` was tagged), a maintenance
106-
branch should be created for future patch releases:
57+
When releasing a new major or minor version (e.g. 4.0.0), the default branch
58+
should be renamed to the next version (e.g. 4.1). Renaming the default branch
59+
using GitHub's UI ensures that all open pull request are changed to target the
60+
new version.
61+
Once the default branch has been renamed, create the maintenance branch for the
62+
version to be released (e.g. 4.0):
10763

10864
```console
109-
$ git checkout -b vX.Y
110-
$ git push mongodb vX.Y
111-
```
112-
113-
Update the master branch alias in `composer.json`:
114-
115-
```diff
116-
"extra": {
117-
"branch-alias": {
118-
- "dev-master": "4.0.x-dev"
119-
+ "dev-master": "4.1.x-dev"
120-
}
121-
},
122-
```
123-
124-
Commit and push this change:
125-
126-
```console
127-
$ git commit -m "Master is now X.Y-dev" composer.json
128-
$ git push mongodb
65+
$ git checkout -b X.Y
66+
$ git push mongodb X.Y
12967
```
13068

13169
### After releasing a patch version
13270

133-
If this was a patch release, the maintenance branch must be merged up to master:
71+
If this was a patch release, the maintenance branch must be merged up to the
72+
default branch (e.g. 4.1):
13473

13574
```console
136-
$ git checkout master
137-
$ git pull mongodb master
138-
$ git merge vX.Y --strategy=ours
75+
$ git checkout 4.1
76+
$ git pull mongodb 4.1
77+
$ git merge 4.0 --strategy=ours
13978
$ git push mongodb
14079
```
14180

14281
The `--strategy=ours` option ensures that all changes from the merged commits
143-
will be ignored. This is OK because we previously ensured that the `master`
82+
will be ignored. This is OK because we previously ensured that the `4.1`
14483
branch was up-to-date with all code changes in this maintenance branch before
14584
tagging.
14685

0 commit comments

Comments
 (0)