|
1 | 1 | # Releasing
|
2 | 2 |
|
3 |
| -> Visit the documentation for [details about release schedule]. |
| 3 | +> Visit the documentation for [details about release schedule](https://docs.openzeppelin.com/contracts/releases-stability). |
4 | 4 |
|
5 |
| -Start on an up-to-date `master` branch. |
| 5 | +OpenZeppelin Contracts uses a fully automated release process that takes care of compiling, packaging, and publishing the library, all of which is carried out in a clean CI environment (GitHub Actions), implemented in the ([`release-cycle`](.github/workflows/release-cycle.yml)) workflow. This helps to reduce the potential for human error and inconsistencies, and ensures that the release process is ongoing and reliable. |
6 | 6 |
|
7 |
| -Create the release branch with `npm run release start minor`. |
| 7 | +## Changesets |
8 | 8 |
|
9 |
| -Publish a release candidate with `npm run release rc`. |
| 9 | +[Changesets](https://github.com/changesets/changesets/) is used as part of our release process for `CHANGELOG.md` management. Each change that is relevant for the codebase is expected to include a changeset. |
10 | 10 |
|
11 |
| -Publish the final release with `npm run release final`. |
| 11 | +## Branching model |
12 | 12 |
|
13 |
| -Follow the general [OpenZeppelin Contracts release checklist]. |
| 13 | +The release cycle happens on release branches called `release-vX.Y`. Each of these branches starts as a release candidate (rc) and is eventually promoted to final. |
14 | 14 |
|
15 |
| -[details about release schedule]: https://docs.openzeppelin.com/contracts/releases-stability |
16 |
| -[OpenZeppelin Contracts release checklist]: https://github.com/OpenZeppelin/code-style/blob/master/RELEASE_CHECKLIST.md |
| 15 | +A release branch can be updated with cherry-picked patches from `master`, or may sometimes be committed to directly in the case of old releases. These commits will lead to a new release candidate or a patch increment depending on the state of the release branch. |
17 | 16 |
|
| 17 | +```mermaid |
| 18 | + %%{init: {'gitGraph': {'mainBranchName': 'master'}} }%% |
| 19 | + gitGraph |
| 20 | + commit id: "Feature A" |
| 21 | + commit id: "Feature B" |
| 22 | + branch release-vX.Y |
| 23 | + commit id: "Start release" |
| 24 | + commit id: "Release vX.Y.0-rc.0" |
18 | 25 |
|
19 |
| -## Merging the release branch |
| 26 | + checkout master |
| 27 | + commit id: "Feature C" |
| 28 | + commit id: "Fix A" |
20 | 29 |
|
21 |
| -After the final release, the release branch should be merged back into `master`. This merge must not be squashed because it would lose the tagged release commit. Since the GitHub repo is set up to only allow squashed merges, the merge should be done locally and pushed. |
| 30 | + checkout release-vX.Y |
| 31 | + cherry-pick id: "Fix A" tag: "" |
| 32 | + commit id: "Release vX.Y.0-rc.1" |
| 33 | + commit id: "Release vX.Y.0" |
22 | 34 |
|
23 |
| -Make sure to have the latest changes from `upstream` in your local release branch. |
| 35 | + checkout master |
| 36 | + merge release-vX.Y |
| 37 | + commit id: "Feature D" |
| 38 | + commit id: "Patch B" |
24 | 39 |
|
| 40 | + checkout release-vX.Y |
| 41 | + cherry-pick id: "Patch B" tag: "" |
| 42 | + commit id: "Release vX.Y.1" |
| 43 | + |
| 44 | + checkout master |
| 45 | + merge release-vX.Y |
| 46 | + commit id: "Feature E" |
25 | 47 | ```
|
26 |
| -git checkout release-vX.Y.Z |
27 |
| -git pull upstream |
28 |
| -``` |
29 |
| - |
30 |
| -``` |
31 |
| -git checkout master |
32 |
| -git merge --no-ff release-vX.Y.Z |
33 |
| -git push upstream master |
34 |
| -``` |
35 |
| - |
36 |
| -The release branch can then be deleted on GitHub. |
|
0 commit comments