@@ -296,18 +296,27 @@ generation script.
296
296
297
297
## Releasing
298
298
299
- The following steps outline the release process for both new minor versions (e.g.
300
- releasing the ` master ` branch as X.Y.0) and patch versions (e.g. releasing the
301
- ` vX.Y ` branch as X.Y.Z).
299
+ ### Branch management
302
300
303
- The command examples below assume that the canonical "mongodb" repository has
304
- the remote name "mongodb". You may need to adjust these commands if you've given
305
- the remote another name (e.g. "upstream"). The "origin" remote name was not used
306
- as it likely refers to your personal fork.
301
+ When releasing a new minor version of the driver (i.e. ` vX.Y.0 ` ), create a new
302
+ maintenance branch named ` vX.Y ` from the default branch. Then, update the
303
+ version information in the default branch to the next minor release:
307
304
308
- It helps to keep your own fork in sync with the "mongodb" repository (i.e. any
309
- branches and tags on the main repository should also exist in your fork). This
310
- is left as an exercise to the reader.
305
+ ``` shell
306
+ $ ./bin/update-release-version.php minor
307
+ ```
308
+
309
+ Commit and push the resulting changes:
310
+
311
+ ``` shell
312
+ $ git commit -m " Master is now X.Y-dev" phongo_version.h
313
+ $ git push mongodb
314
+ ```
315
+
316
+ Before starting the release process, make sure that all open merge-up pull
317
+ requests containing changes from the release branch have been merged. Handling
318
+ the merge conflicts resulting from the version updates will be much more
319
+ difficult if other changes need merging.
311
320
312
321
### Transition JIRA issues and version
313
322
@@ -323,7 +332,64 @@ Update the version's release date and status from the
323
332
[ Manage Versions] ( https://jira.mongodb.org/plugins/servlet/project-config/PHPC/versions )
324
333
page.
325
334
326
- ### Update version info
335
+ ### Trigger the release workflow
336
+
337
+ Releases are done automatically through a GitHub Action. Visit the corresponding
338
+ [ Release New Version] ( https://github.com/mongodb/mongo-php-driver/actions/workflows/release.yml )
339
+ workflow page to trigger a new build. Select the correct branch (e.g. ` v1.18 ` )
340
+ and trigger a new run using the "Run workflow" button. In the following prompt,
341
+ enter the version number and the corresponding JIRA release number for the
342
+ release. This will create and push the necessary commits and tag, create a draft
343
+ release, and trigger the packaging builds for the newly created tag. The release
344
+ is created in a draft state and can be published once the release notes have
345
+ been updated.
346
+
347
+ ### Upload package to PECL
348
+
349
+ Once the packaging workflow has finished creating the PECL package, it will be
350
+ published as a build artifact of the package workflow, as well as a release
351
+ artifact in the draft release. This package may be published via the
352
+ [ Release Upload] ( https://pecl.php.net/release-upload.php ) form. You will have
353
+ one chance to confirm the package information after uploading.
354
+
355
+ > ** Note:** If downloading the package from the build artifacts, be aware that
356
+ > these are always provided as zip files. You'll have to unpack the tgz archive
357
+ > prior to uploading it to PECL.
358
+
359
+ ### Update compatibility tables in MongoDB docs
360
+
361
+ For minor releases, create a DOCSP ticket indicating whether there are changes
362
+ to MongoDB Server or PHP version compatibility. The [ compatibility tables] ( https://docs.mongodb.com/drivers/driver-compatibility-reference#php-driver-compatibility )
363
+ in the MongoDB documentation must be updated to account for new releases. Make
364
+ sure to update both MongoDB and Language compatibility tables, as shown in
365
+ [ this pull request] ( https://github.com/mongodb/docs-ecosystem/pull/642 ) .
366
+
367
+ ### Handle merge-up pull request
368
+
369
+ After the release automation pushes changes to the stable branch the release was
370
+ created from, the merge automation will create a new pull request to merge these
371
+ changes into the next versioned branch. Since version changes always create a
372
+ conflict, follow the "Ignoring Changes" section in the pull request to resolve
373
+ the conflicts and merge the pull request once the build completes.
374
+
375
+ ### Manual release process
376
+
377
+ The following steps outline the manual release process for both new minor
378
+ versions (e.g. releasing the ` master ` branch as X.Y.0) and patch versions (e.g.
379
+ releasing the ` vX.Y ` branch as X.Y.Z). These are preserved for historical
380
+ reasons and cases that are currently not supported by the release automation
381
+ (e.g. beta releases).
382
+
383
+ The command examples below assume that the canonical "mongodb" repository has
384
+ the remote name "mongodb". You may need to adjust these commands if you've given
385
+ the remote another name (e.g. "upstream"). The "origin" remote name was not used
386
+ as it likely refers to your personal fork.
387
+
388
+ It helps to keep your own fork in sync with the "mongodb" repository (i.e. any
389
+ branches and tags on the main repository should also exist in your fork). This
390
+ is left as an exercise to the reader.
391
+
392
+ #### Update version info
327
393
328
394
The PHP driver uses [ semantic versioning] ( http://semver.org/ ) . Do not break
329
395
backwards compatibility in a non-major release or your users will kill you.
@@ -333,17 +399,11 @@ changes in this maintenance branch. This is important because we will later
333
399
merge the ensuing release commits up to master with ` --strategy=ours ` , which
334
400
will ignore changes from the merged commits.
335
401
336
- Update the version and stability constants in ` phongo_version.h ` . This should
337
- entail removing the version's "-dev" suffix, changing the stability to
338
- "stable", and increasing the last digit for ` PHP_MONGO_VERSION_DESC ` :
402
+ Update the version and stability constants in ` phongo_version.h ` for the stable
403
+ release:
339
404
340
- ``` diff
341
- - #define PHP_MONGODB_VERSION "1.1.8-dev"
342
- - #define PHP_MONGODB_STABILITY "devel"
343
- - #define PHP_MONGODB_VERSION_DESC 1,1,8,0
344
- + #define PHP_MONGODB_VERSION "1.1.8"
345
- + #define PHP_MONGODB_STABILITY "stable"
346
- + #define PHP_MONGODB_VERSION_DESC 1,1,8,1
405
+ ``` shell
406
+ $ ./bin/update-release-version.php stable
347
407
```
348
408
349
409
The Makefile targets for creating the PECL package depend on these constants, so
@@ -359,7 +419,7 @@ you must rebuild the extension after updating `phongo_version.h`.
359
419
> ` PHP_MONGODB_VERSION ` , increment the last digit of
360
420
> ` PHP_MONGODB_VERSION_DESC ` .
361
421
362
- ### Build PECL package
422
+ #### Build PECL package
363
423
364
424
Create the PECL package description file with ` make package.xml ` . This creates
365
425
a ` package.xml ` file from a template. Version, author, and file information will
@@ -377,32 +437,11 @@ $ pecl install -f mongodb-X.Y.Z.tgz
377
437
Commit the modified ` phongo_version.h ` file and push this change:
378
438
379
439
```
380
- $ git add phongo_version.h
381
- $ git commit -m "Package X.Y.Z"
440
+ $ git commit -m "Package X.Y.Z" phongo_version.h
382
441
$ git push mongodb
383
442
```
384
443
385
- > ** Note:** Pushing this commit independently from the subsequent "Back to -dev"
386
- > commit will ensure that Windows build artifacts are created for the release.
387
-
388
- ### Ensure Windows build artifacts exist
389
-
390
- Windows builds are tested by GitHub Actions. Each successful build for a pushed
391
- commit will produce a build artifact consisting of DLL and PDB files for that
392
- environment (e.g. 8.0-nts-x64). These build artifacts are later used to create
393
- release assets (see:
394
- [ windows-release-build.yml] ( .github/workflows/windows-release-build.yml ) ).
395
-
396
- Before publishing a release in GitHub, ensure that all Windows builds for the
397
- tag's commit have succeeded and that the necessary build artifacts have been
398
- created. This can be done by examining the build artifacts in the workflow run
399
- summary for the "Package X.Y.Z" commit (i.e. tag target).
400
-
401
- > ** Note:** the "published" event applies to both releases and pre-releases. See
402
- > [ Events that trigger workflows: release] ( https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release )
403
- > for more details.
404
-
405
- ### Tag the release
444
+ #### Tag the release
406
445
407
446
Create a tag for the release and push:
408
447
@@ -411,24 +450,22 @@ $ git tag -a -m "Release X.Y.Z" X.Y.Z
411
450
$ git push mongodb --tags
412
451
```
413
452
414
- ### Release PECL package
453
+ Pushing the new tag will start the packaging process which provides the PECL
454
+ and Windows packages that should be attached to the release.
455
+
456
+ #### Release PECL package
415
457
416
458
The PECL package may be published via the
417
459
[ Release Upload] ( https://pecl.php.net/release-upload.php ) form. You will have
418
460
one chance to confirm the package information after uploading.
419
461
420
- ### Update version info back to dev
462
+ #### Update version info back to dev
421
463
422
464
After tagging, the version and stability constants in ` phongo_version.h ` should
423
- be updated back to development status.
465
+ be updated back to development status:
424
466
425
- ``` diff
426
- - #define PHP_MONGODB_VERSION "1.1.8"
427
- - #define PHP_MONGODB_STABILITY "stable"
428
- - #define PHP_MONGODB_VERSION_DESC 1,1,8,1
429
- + #define PHP_MONGODB_VERSION "1.1.9-dev"
430
- + #define PHP_MONGODB_STABILITY "devel"
431
- + #define PHP_MONGODB_VERSION_DESC 1,1,9,0
467
+ ``` shell
468
+ $ ./bin/update-release-version.php patch
432
469
```
433
470
434
471
Commit and push this change:
@@ -444,52 +481,7 @@ $ git push mongodb
444
481
> "1.4.0beta1" and "beta" for the first beta release, this step would see them
445
482
> ultimately changed to "1.4.0beta2-dev" and "devel".
446
483
447
- ### Branch management
448
-
449
- #### After releasing a new minor version
450
-
451
- After a new minor version is released (i.e. ` master ` was tagged), a maintenance
452
- branch should be created for future patch releases:
453
-
454
- ```
455
- $ git checkout -b vX.Y
456
- $ git push mongodb vX.Y
457
- ```
458
-
459
- Update ` phongo_version.h ` for the ` master ` branch:
460
-
461
- ``` diff
462
- - #define PHP_MONGODB_VERSION "1.15.1-dev"
463
- + #define PHP_MONGODB_VERSION "1.16.0-dev"
464
- #define PHP_MONGODB_STABILITY "devel"
465
- - #define PHP_MONGODB_VERSION_DESC 1,15,1,0
466
- + #define PHP_MONGODB_VERSION_DESC 1,16,0,0
467
- ```
468
-
469
- Commit and push this change:
470
-
471
- ```
472
- $ git commit -m "Master is now X.Y-dev" phongo_version.h
473
- $ git push mongodb
474
- ```
475
-
476
- #### After releasing a patch version
477
-
478
- If this was a patch release, the maintenance branch must be merged up to master:
479
-
480
- ```
481
- $ git checkout master
482
- $ git pull mongodb master
483
- $ git merge vX.Y --strategy=ours
484
- $ git push mongodb
485
- ```
486
-
487
- The ` --strategy=ours ` option ensures that all changes from the merged commits
488
- will be ignored. This is OK because we previously ensured that the ` master `
489
- branch was up-to-date with all code changes in this maintenance branch before
490
- tagging.
491
-
492
- ### Publish release notes
484
+ #### Publish release notes
493
485
494
486
The following template should be used for creating GitHub release notes via
495
487
[ this form] ( https://github.com/mongodb/mongo-php-driver/releases/new ) . The PECL
@@ -543,10 +535,3 @@ Thanks for our community contributors for X.Y.Z:
543
535
544
536
Significant release announcements should also be posted in the
545
537
[ MongoDB Product & Driver Announcements: Driver Releases] ( https://www.mongodb.com/community/forums/tags/c/announcements/driver-releases/110/php ) forum.
546
-
547
- ### Update compatibility tables in MongoDB docs
548
-
549
- For minor releases, create a DOCSP ticket indicating whether there are changes to MongoDB Server or PHP version
550
- compatibility. The [ compatibility tables] ( https://docs.mongodb.com/drivers/driver-compatibility-reference#php-driver-compatibility )
551
- in the MongoDB documentation must be updated to account for new releases. Make sure to update both MongoDB and Language
552
- compatibility tables, as shown in [ this pull request] ( https://github.com/mongodb/docs-ecosystem/pull/642 ) .
0 commit comments