Skip to content

Commit 6d18435

Browse files
ernestognwfrangio
andauthored
Add RELEASING.md docs (#3981)
Co-authored-by: Francisco Giordano <[email protected]>
1 parent 2c711d0 commit 6d18435

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

.github/workflows/release-cycle.yml

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# D: Manual Dispatch
2+
# M: Merge release PR
3+
# C: Commit
4+
# ┌───────────┐ ┌─────────────┐ ┌────────────────┐
5+
# │Development├──D──►RC-Unreleased│ ┌──►Final-Unreleased│
6+
# └───────────┘ └─┬─────────▲─┘ │ └─┬────────────▲─┘
7+
# │ │ │ │ │
8+
# M C D M C
9+
# │ │ │ │ │
10+
# ┌▼─────────┴┐ │ ┌▼────────────┴┐
11+
# │RC-Released├───┘ │Final-Released│
12+
# └───────────┘ └──────────────┘
113
name: Release Cycle
214

315
on:

CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Any non-trivial code contribution must be first discussed with the maintainers i
2929

3030
Make sure to read and follow the [engineering guidelines](./GUIDELINES.md). Run linter and tests to make sure your pull request is good before submitting it.
3131

32+
Changelog entries should be added to each pull request by using [Changesets](https://github.com/changesets/changesets/).
33+
3234
When opening the pull request you will be presented with a template and a series of instructions. Read through it carefully and follow all the steps. Expect a review and feedback from the maintainers afterwards.
3335

3436
If you're looking for a good place to start, look for issues labelled ["good first issue"](https://github.com/OpenZeppelin/openzeppelin-contracts/labels/good%20first%20issue)!

RELEASING.md

+33-22
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,47 @@
11
# Releasing
22

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).
44
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.
66

7-
Create the release branch with `npm run release start minor`.
7+
## Changesets
88

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.
1010

11-
Publish the final release with `npm run release final`.
11+
## Branching model
1212

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.
1414

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.
1716

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"
1825
19-
## Merging the release branch
26+
checkout master
27+
commit id: "Feature C"
28+
commit id: "Fix A"
2029
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"
2234
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"
2439
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"
2547
```
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

Comments
 (0)