Skip to content

Commit ab400ec

Browse files
jmikolaalcaeus
andauthored
Revise release instructions (#1384)
Push "Package X.Y.Z" and "Back to -dev" commits separately to ensure Windows build artifacts are created for the tag. Add instructions for creating a maintenance branch after releasing a new minor version. * Use diff code blocks for more concise examples * Apply syntax highlighting to release notes examples Co-authored-by: Andreas Braun <[email protected]>
1 parent a86a162 commit ab400ec

File tree

1 file changed

+93
-60
lines changed

1 file changed

+93
-60
lines changed

CONTRIBUTING.md

Lines changed: 93 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,18 @@ generation script.
281281

282282
## Releasing
283283

284-
The follow steps outline the release process for a maintenance branch (e.g.
285-
releasing the `vX.Y` branch as X.Y.Z).
284+
The following steps outline the release process for both new minor versions (e.g.
285+
releasing the `master` branch as X.Y.0) and patch versions (e.g. releasing the
286+
`vX.Y` branch as X.Y.Z).
287+
288+
The command examples below assume that the canonical "mongodb" repository has
289+
the remote name "mongodb". You may need to adjust these commands if you've given
290+
the remote another name (e.g. "upstream"). The "origin" remote name was not used
291+
as it likely refers to your personal fork.
292+
293+
It helps to keep your own fork in sync with the "mongodb" repository (i.e. any
294+
branches and tags on the main repository should also exist in your fork). This
295+
is left as an exercise to the reader.
286296

287297
### Transition JIRA issues and version
288298

@@ -312,18 +322,13 @@ Update the version and stability constants in `phongo_version.h`. This should
312322
entail removing the version's "-dev" suffix, changing the stability to
313323
"stable", and increasing the last digit for `PHP_MONGO_VERSION_DESC`:
314324

315-
```
316-
#define PHP_MONGODB_VERSION "1.1.8-dev"
317-
#define PHP_MONGODB_STABILITY "devel"
318-
#define PHP_MONGODB_VERSION_DESC 1,1,8,0
319-
```
320-
321-
The above would be changed to:
322-
323-
```
324-
#define PHP_MONGODB_VERSION "1.1.8"
325-
#define PHP_MONGODB_STABILITY "stable"
326-
#define PHP_MONGODB_VERSION_DESC 1,1,8,1
325+
```diff
326+
-#define PHP_MONGODB_VERSION "1.1.8-dev"
327+
-#define PHP_MONGODB_STABILITY "devel"
328+
-#define PHP_MONGODB_VERSION_DESC 1,1,8,0
329+
+#define PHP_MONGODB_VERSION "1.1.8"
330+
+#define PHP_MONGODB_STABILITY "stable"
331+
+#define PHP_MONGODB_VERSION_DESC 1,1,8,1
327332
```
328333

329334
The Makefile targets for creating the PECL package depend on these constants, so
@@ -352,46 +357,70 @@ After copying release notes, use `make package` to create the package file (e.g.
352357
$ pecl install -f mongodb-X.Y.Z.tgz
353358
```
354359

355-
### Commit version update and release notes
360+
### Update version info
356361

357-
Commit the modified `phongo_version.h` file as "Package X.Y.Z"
362+
Commit the modified `phongo_version.h` file and push this change:
358363

359364
```
360365
$ git add phongo_version.h
361366
$ git commit -m "Package X.Y.Z"
367+
$ git push mongodb
362368
```
363369

364-
### Tag release
370+
> **Note:** Pushing this commit independently from the subsequent "Back to -dev"
371+
> commit will ensure that Windows build artifacts are created for the release.
372+
373+
### Ensure Windows build artifacts exist
374+
375+
Windows builds are tested by GitHub Actions. Each successful build for a pushed
376+
commit will produce a build artifact consisting of DLL and PDB files for that
377+
environment (e.g. 8.0-nts-x64). These build artifacts are later used to create
378+
release assets (see:
379+
[windows-release-build.yml](.github/workflows/windows-release-build.yml)).
380+
381+
Before publishing a release in GitHub, ensure that all Windows builds for the
382+
tag's commit have succeeded and that the necessary build artifacts have been
383+
created. This can be done by examining the build artifacts in the workflow run
384+
summary for the "Package X.Y.Z" commit (i.e. tag target).
385+
386+
> **Note:** the "published" event applies to both releases and pre-releases. See
387+
> [Events that trigger workflows: release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
388+
> for more details.
389+
390+
### Tag the release
365391

366-
The previous commit will be the target for our release tag:
392+
Create a tag for the release and push:
367393

368394
```
369395
$ git tag -a -m "Release X.Y.Z" X.Y.Z
396+
$ git push mongodb --tags
370397
```
371398

372-
### Update version info back to dev
399+
### Release PECL package
373400

374-
After tagging, the version and stability constants in `phongo_version.h` should be
375-
updated back to development status.
401+
The PECL package may be published via the
402+
[Release Upload](https://pecl.php.net/release-upload.php) form. You will have
403+
one chance to confirm the package information after uploading.
376404

377-
```
378-
#define PHP_MONGODB_VERSION "1.1.8"
379-
#define PHP_MONGODB_STABILITY "stable"
380-
#define PHP_MONGODB_VERSION_DESC 1,1,8,1
381-
```
405+
### Update version info back to dev
382406

383-
The above would be changed to:
407+
After tagging, the version and stability constants in `phongo_version.h` should
408+
be updated back to development status.
384409

385-
```
386-
#define PHP_MONGODB_VERSION "1.1.9-dev"
387-
#define PHP_MONGODB_STABILITY "devel"
388-
#define PHP_MONGODB_VERSION_DESC 1,1,9,0
410+
```diff
411+
-#define PHP_MONGODB_VERSION "1.1.8"
412+
-#define PHP_MONGODB_STABILITY "stable"
413+
-#define PHP_MONGODB_VERSION_DESC 1,1,8,1
414+
+#define PHP_MONGODB_VERSION "1.1.9-dev"
415+
+#define PHP_MONGODB_STABILITY "devel"
416+
+#define PHP_MONGODB_VERSION_DESC 1,1,9,0
389417
```
390418

391-
Commit this change:
419+
Commit and push this change:
392420

393421
```
394422
$ git commit -m "Back to -dev" phongo_version.h
423+
$ git push mongodb
395424
```
396425

397426
> **Note:** If this is an alpha, beta, or RC release, the version string should
@@ -400,65 +429,69 @@ $ git commit -m "Back to -dev" phongo_version.h
400429
> "1.4.0beta1" and "beta" for the first beta release, this step would see them
401430
> ultimately changed to "1.4.0beta2-dev" and "devel".
402431
403-
### Push commits and tags
432+
### Branch management
433+
434+
#### After releasing a new minor version
435+
436+
After a new minor version is released (i.e. `master` was tagged), a maintenance
437+
branch should be created for future patch releases:
404438

405439
```
406-
$ git push
407-
$ git push --tags
440+
$ git checkout -b vX.Y
441+
$ git push mongodb vX.Y
408442
```
409443

410-
### Ensure Windows build artifacts exist
444+
Update `phongo_version.h` for the `master` branch:
411445

412-
Windows builds are tested by GitHub Actions. Each successful build for a pushed
413-
commit will produce a build artifact consisting of DLL and PDB files for that
414-
environment (e.g. 8.0-nts-x64). These build artifacts are later used to create
415-
release assets (see:
416-
[windows-release-build.yml])(.github/workflows/windows-release-build.yml).
417-
Before publishing a release in GitHub, ensure that all Windows builds for the
418-
tag's commit have succeeded and that the necessary build artifacts have been
419-
created.
446+
```diff
447+
-#define PHP_MONGODB_VERSION "1.15.1-dev"
448+
+#define PHP_MONGODB_VERSION "1.16.0-dev"
449+
#define PHP_MONGODB_STABILITY "devel"
450+
-#define PHP_MONGODB_VERSION_DESC 1,15,1,0
451+
+#define PHP_MONGODB_VERSION_DESC 1,16,0,0
452+
```
420453

421-
Note: the "published" event applies to both releases and pre-releases. See
422-
[Events that trigger workflows: release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
423-
for more details.
454+
Commit and push this change:
424455

425-
### Release PECL package
456+
```
457+
$ git commit -m "Master is now X.Y-dev" phongo_version.h
458+
$ git push mongodb
459+
```
426460

427-
The PECL package may be published via the
428-
[Release Upload](https://pecl.php.net/release-upload.php) form. You will have
429-
one chance to confirm the package information after uploading.
461+
#### After releasing a patch version
430462

431-
### Merge the maintenance branch up to master
463+
If this was a patch release, the maintenance branch must be merged up to master:
432464

433465
```
434466
$ git checkout master
467+
$ git pull mongodb master
435468
$ git merge vX.Y --strategy=ours
436-
$ git push
469+
$ git push mongodb
437470
```
438471

439472
The `--strategy=ours` option ensures that all changes from the merged commits
440-
will be ignored.
473+
will be ignored. This is OK because we previously ensured that the `master`
474+
branch was up-to-date with all code changes in this maintenance branch before
475+
tagging.
441476

442477
### Publish release notes
443478

444479
The following template should be used for creating GitHub release notes via
445480
[this form](https://github.com/mongodb/mongo-php-driver/releases/new). The PECL
446481
package may also be attached to the release notes.
447482

448-
```
483+
```markdown
449484
The PHP team is happy to announce that version X.Y.Z of the [mongodb](https://pecl.php.net/package/mongodb) PHP extension is now available on PECL.
450485

451486
**Release Highlights**
452487

453488
<one or more paragraphs describing important changes in this release>
454489

455-
A complete list of resolved issues in this release may be found at:
456-
$JIRA_URL
490+
A complete list of resolved issues in this release may be found in [JIRA]($JIRA_URL).
457491

458492
**Documentation**
459493

460-
Documentation is available on PHP.net:
461-
https://www.php.net/set.mongodb
494+
Documentation is available on [PHP.net](https://php.net/set.mongodb).
462495

463496
**Installation**
464497

@@ -485,7 +518,7 @@ release. You may obtain the list from
485518
If commits from community contributors were included in this release, append the
486519
following section:
487520

488-
```
521+
```markdown
489522
**Thanks**
490523

491524
Thanks for our community contributors for X.Y.Z:

0 commit comments

Comments
 (0)