Skip to content

Commit 7fad078

Browse files
committed
Merge pull request #332
2 parents fccce24 + e1e97f8 commit 7fad078

File tree

1 file changed

+215
-0
lines changed

1 file changed

+215
-0
lines changed

CONTRIBUTING.md

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,219 @@ These are automatically executed by the `make distcheck`, which will package a n
5959
spin up the various operating systems, install the newly packaged archive, and execute
6060
the test suite.
6161

62+
## Releasing
6263

64+
The follow steps outline the release process for a maintenance branch (e.g.
65+
releasing the `vX.Y` branch as X.Y.Z).
66+
67+
### Ensure PHP version compatibility
68+
69+
Ensure that the extension compiles on PHP 5.4, 5.5, 5.6, and 7.0. Be sure to
70+
test both ZTS and non-ZTS builds for PHP 5.x.
71+
72+
### Ensure Windows compatibility
73+
74+
PECL will create Windows DLLs for new releases; however, you must ensure that
75+
the extension successfully builds on Windows before releasing. Note that PHP 5.5
76+
and 5.6 require VS2012, while PHP 7 requires VS2015.
77+
78+
Given the following assumptions:
79+
80+
* Build directory is `C:\php-sdk\`
81+
* Compiling for PHP 5.6 (VS2012 x86 Native Tools Command Prompt is running)
82+
* Extension branch checked out in `C:\php-sdk\phpdev\vc11\x86\pecl\mongodb`
83+
84+
The build process will resemble:
85+
86+
```
87+
cd c:\php-sdk\
88+
bin\phpsdk_setvars.bat
89+
90+
cd C:\php-sdk\phpdev\vc11\x86\php-5.6.12-src
91+
nmake clean
92+
buildconf --force
93+
configure --disable-all --with-openssl --enable-cli --enable-json --enable-mongodb
94+
nmake
95+
```
96+
97+
If the extension was successfully compiled, "mongodb" should be reported by
98+
`Release_TS\php.exe -m`.
99+
100+
See the [internals wiki](https://wiki.php.net/internals/windows/stepbystepbuild)
101+
for more information.
102+
103+
### Transition JIRA issues and version
104+
105+
Update the fix version field for all resolved issues with the corresponding ".x"
106+
fix version.
107+
108+
Update the version's release date and status from the
109+
[Manage Versions](https://jira.mongodb.org/plugins/servlet/project-config/PHPC/versions)
110+
page.
111+
112+
Transition all resolved issues for this version to the closed state. If changing
113+
the issues in bulk, be sure to allow email notifications.
114+
115+
### Update version info
116+
117+
The PHP driver uses [semantic versioning](http://semver.org/). Do not break
118+
backwards compatibility in a non-major release or your users will kill you.
119+
120+
Before proceeding, ensure that the `master` branch is up-to-date with all code
121+
changes in this maintenance branch. This is important because we will later
122+
merge the ensuing release commits up to master with `--strategy=ours`, which
123+
will ignore changes from the merged commits.
124+
125+
Update the version and stability constants in `php_phongo.h`. This should entail
126+
removing the version's "-dev" suffix and changing the stability to "stable":
127+
128+
```
129+
#define MONGODB_VERSION_S "1.1.8-dev"
130+
#define MONGODB_STABILITY_S "devel"
131+
```
132+
133+
The above would be changed to:
134+
135+
```
136+
#define MONGODB_VERSION_S "1.1.8"
137+
#define MONGODB_STABILITY_S "stable"
138+
```
139+
140+
The Makefile targets for creating the PECL package depend on these constants, so
141+
you must rebuild the extension after updating `php_phongo.h`.
142+
143+
### Publish PECL package
144+
145+
Create the PECL package with `make package`. This should generate a `Changelog`
146+
file, which Git ignores, and add its contents to relevant `RELEASE-X.Y` file.
147+
Additionally, the `package.xml` file will be created from a template and a
148+
`mongodb-X.Y.Z.tgz` package file will be created.
149+
150+
Ensure that the generated PECL package can be successfully installed:
151+
152+
```
153+
$ pecl install -f mongodb-X.Y.Z.tgz
154+
```
155+
156+
The PECL package may be published via the
157+
[Release Upload](https://pecl.php.net/release-upload.php) form. You will have
158+
one chance to confirm the package information after uploading.
159+
160+
### Commit version update and release notes
161+
162+
Commit the modified `php_phongo.h` and `RELEASE-X.Y` files as "Package X.Y.Z"
163+
164+
```
165+
$ git add php_phongo.h RELEASE-X.Y
166+
$ git commit -m "Package X.Y.Z"
167+
```
168+
169+
### Tag release
170+
171+
The previous commit will be the target for our release tag:
172+
173+
```
174+
$ git tag -a -m "Release X.Y.Z" X.Y.Z
175+
```
176+
177+
### Update version info back to dev
178+
179+
After tagging, the version and stability constants in `php_phongo.h` should be
180+
updated back to development status.
181+
182+
```
183+
#define MONGODB_VERSION_S "1.1.8"
184+
#define MONGODB_STABILITY_S "stable"
185+
```
186+
187+
The above would be changed to:
188+
189+
```
190+
#define MONGODB_VERSION_S "1.1.9-dev"
191+
#define MONGODB_STABILITY_S "devel"
192+
```
193+
194+
Commit this change:
195+
196+
```
197+
$ git commit -m "Back to -dev" php_phongo.h
198+
```
199+
200+
### Push commits and tags
201+
202+
```
203+
$ git push
204+
$ git push --tags
205+
```
206+
207+
### Merge the maintenance branch up to master
208+
209+
```
210+
$ git checkout master
211+
$ git merge vX.Y --strategy=ours
212+
$ git push
213+
```
214+
215+
The `--strategy=ours` option ensures that all changes from the merged commits
216+
will be ignored.
217+
218+
### Publish release notes
219+
220+
The following template should be used for creating GitHub release notes via
221+
[this form](https://github.com/mongodb/mongo-php-driver/releases/new). The PECL
222+
package may also be attached to the release notes.
223+
224+
```
225+
The PHP team is happy to announce that version X.Y.Z of our new [mongodb](http://pecl.php.net/package/mongodb) PHP extension is now available on PECL.
226+
227+
**Release Highlights**
228+
229+
<one or more paragraphs describing important changes in this release>
230+
231+
A complete list of resolved issues in this release may be found at:
232+
$JIRA_URL
233+
234+
**Documentation**
235+
236+
Documentation is available on PHP.net:
237+
http://php.net/set.mongodb
238+
239+
**Feedback**
240+
241+
We would appreciate any feedback you might have on the project:
242+
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12484&issuetype=6
243+
244+
**Installation**
245+
246+
You can either download and install the source manually, or you can install the extension with:
247+
248+
pecl install mongodb
249+
250+
or update with:
251+
252+
pecl upgrade mongodb
253+
254+
Windows binaries are available on PECL:
255+
http://pecl.php.net/package/mongodb
256+
```
257+
258+
The URL for the list of resolved JIRA issues will need to be updated with each
259+
release. You may obtain the list from
260+
[this form](https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12484).
261+
262+
If commits from community contributors were included in this release, append the
263+
following section:
264+
265+
```
266+
**Thanks**
267+
268+
Thanks for our community contributors for X.Y.Z:
269+
270+
* [$CONTRIBUTOR_NAME](https://github.com/$GITHUB_USERNAME)
271+
```
272+
273+
Release announcements should also be sent to the `[email protected]`
274+
and `[email protected]` mailing lists.
275+
276+
Consider announcing each release on Twitter. Significant releases should also be
277+
announced via [@MongoDB](http://twitter.com/mongodb) as well.

0 commit comments

Comments
 (0)