@@ -203,8 +203,18 @@ $ git commit -m "Master is now 1.10-dev" composer.json
203
203
204
204
## Releasing
205
205
206
- The follow steps outline the release process for a maintenance branch (e.g.
207
- releasing the ` vX.Y ` branch as X.Y.Z).
206
+ The following steps outline the release process for both new minor versions (e.g.
207
+ releasing the ` master ` branch as X.Y.0) and patch versions (e.g. releasing the
208
+ ` vX.Y ` branch as X.Y.Z).
209
+
210
+ The command examples below assume that the canonical "mongodb" repository has
211
+ the remote name "mongodb". You may need to adjust these commands if you've given
212
+ the remote another name (e.g. "upstream"). The "origin" remote name was not used
213
+ as it likely refers to your personal fork.
214
+
215
+ It helps to keep your own fork in sync with the "mongodb" repository (i.e. any
216
+ branches and tags on the main repository should also exist in your fork). This
217
+ is left as an exercise to the reader.
208
218
209
219
### Ensure PHP version compatibility
210
220
@@ -234,50 +244,118 @@ changes in this maintenance branch. This is important because we will later
234
244
merge the ensuing release commits up to master with ` --strategy=ours ` , which
235
245
will ignore changes from the merged commits.
236
246
237
- ### Tag release
247
+ ### Update composer.json and CI matrices
248
+
249
+ This is especially important before releasing a new minor version.
250
+
251
+ Ensure that the extension requirement and branch alias in ` composer.json ` are
252
+ correct for the library version being released. For example, the 1.15.0 release
253
+ of the library should depend on version ` ^1.15.0 ` of the extension and master
254
+ branch alias should be ` 1.15.x-dev ` .
255
+
256
+ If this is the first release of a minor version for the library, it is likely
257
+ following an extension release. In that case, the ` driver-versions ` matrix in
258
+ the Evergreen configuration should be updated:
259
+
260
+ ``` diff
261
+ - id: "oldest-supported"
262
+ - display_name: "PHPC 1.15-dev"
263
+ + display_name: "PHPC 1.15.0"
264
+ variables:
265
+ - EXTENSION_BRANCH: "master"
266
+ + EXTENSION_VERSION: "1.15.0"
267
+ - id: "latest-stable"
268
+ - display_name: "PHPC 1.15-dev"
269
+ + display_name: "PHPC 1.15.x"
270
+ variables:
271
+ - EXTENSION_BRANCH: "master"
272
+ + EXTENSION_VERSION: "stable"
273
+ - id: "latest-dev"
274
+ - display_name: "PHPC 1.15-dev"
275
+ + display_name: "PHPC 1.16-dev"
276
+ variables:
277
+ EXTENSION_BRANCH: "master"
278
+ ```
279
+
280
+ Commit and push any changes:
281
+
282
+ ```
283
+ $ git commit -m "Update composer.json and CI matrices for X.Y.Z" composer.json .evergreen/config.yml
284
+ $ git push mongodb
285
+ ```
286
+
287
+ ### Tag the release
238
288
239
- The maintenance branch's HEAD will be the target for our release tag :
289
+ Create a tag for the release and push :
240
290
241
291
```
242
292
$ git tag -a -m "Release X.Y.Z" X.Y.Z
293
+ $ git push mongodb --tags
243
294
```
244
295
245
- ### Push tags
296
+ ### Branch management
246
297
298
+ #### After releasing a new minor version
299
+
300
+ After a new minor version is released (i.e. ` master ` was tagged), a maintenance
301
+ branch should be created for future patch releases:
302
+
303
+ ```
304
+ $ git checkout -b vX.Y
305
+ $ git push mongodb vX.Y
306
+ ```
307
+
308
+ Update the master branch alias in ` composer.json ` :
309
+
310
+ ``` diff
311
+ "extra": {
312
+ "branch-alias": {
313
+ - "dev-master": "1.15.x-dev"
314
+ + "dev-master": "1.16.x-dev"
315
+ }
316
+ },
247
317
```
248
- $ git push --tags
318
+
319
+ Commit and push this change:
320
+
321
+ ```
322
+ $ git commit -m "Master is now X.Y-dev" composer.json
323
+ $ git push mongodb
249
324
```
250
325
251
- ### Merge the maintenance branch up to master
326
+ #### After releasing a patch version
327
+
328
+ If this was a patch release, the maintenance branch must be merged up to master:
252
329
253
330
```
254
331
$ git checkout master
332
+ $ git pull mongodb master
255
333
$ git merge vX.Y --strategy=ours
256
- $ git push
334
+ $ git push mongodb
257
335
```
258
336
259
337
The ` --strategy=ours ` option ensures that all changes from the merged commits
260
- will be ignored.
338
+ will be ignored. This is OK because we previously ensured that the ` master `
339
+ branch was up-to-date with all code changes in this maintenance branch before
340
+ tagging.
261
341
262
342
### Publish release notes
263
343
264
344
The following template should be used for creating GitHub release notes via
265
345
[ this form] ( https://github.com/mongodb/mongo-php-library/releases/new ) .
266
346
267
- ```
347
+ ``` markdown
268
348
The PHP team is happy to announce that version X.Y.Z of the MongoDB PHP library is now available.
269
349
270
350
**Release Highlights**
271
351
272
352
<one or more paragraphs describing important changes in this release>
273
353
274
- A complete list of resolved issues in this release may be found at:
275
- $JIRA_URL
354
+ A complete list of resolved issues in this release may be found in [JIRA]($JIRA_URL).
276
355
277
356
**Documentation**
278
357
279
- Documentation for this library may be found at:
280
- https://mongodb.com/docs/php-library/current/
358
+ Documentation for this library may be found in the [PHP Library Manual](https://mongodb.com/docs/php-library/current/).
281
359
282
360
**Installation**
283
361
@@ -295,7 +373,7 @@ release. You may obtain the list from
295
373
If commits from community contributors were included in this release, append the
296
374
following section:
297
375
298
- ```
376
+ ``` markdown
299
377
**Thanks**
300
378
301
379
Thanks for our community contributors for this release:
0 commit comments