You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/contributing/release-branch-cut-and-rc0.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,18 +28,26 @@ Documents in this section go over steps to run different types of React Native r
28
28
git checkout -b 0.69-stable
29
29
```
30
30
31
+
### 2. Update the Hermes version
32
+
31
33
- Head to the [Publish Tag](https://github.com/facebook/hermes/actions/workflows/create-tag.yml) workflow in the Hermes repo. Click the "Run Workflow" button and input the RN stable version you are targeting (e.g. 0.69.0). You need to have write access to the facebook/hermes repo to do so or ask a Meta employee to help you on this step.
32
34
33
35
- Bump the Hermes version on the release branch using this command:
34
36
35
37
```bash
36
38
# Replace <the_hermes_tag> with the tag that will look like 'hermes-2022-07-20-RNv0.70.0-bc97c5399e0789c0a323f8e1431986e207a9e8ba'
- Add and commit the extra file that got created at `sdks/hermes/.hermesversion`.
42
+
- Add and commit the extra file that got created at `packages/react-native/sdks/hermes/.hermesversion`.
43
+
44
+
### 3. Bump monorepo packages
45
+
46
+
- Update packages in the monorepo by running `yarn bump-all-updated-packages`. Bear in mind that all the package bumps must be on patch level, and be on the minor you are working on. We need to publish the latest package changes so they will be included in RC0. Read more about the script and how they work [here](./release-updating-packages).
47
+
48
+
- CI will take care of releasing the new versions on npm once you push the changes to the `0.XX-stable` branch.
41
49
42
-
### 2. Push the branch and test the current changes
50
+
### 4. Push the branch and test the current changes
43
51
44
52
You can now push the branch you created so that others can also start testing:
45
53
@@ -51,7 +59,7 @@ Before continuing further, follow the [testing guide](/contributing/release-test
51
59
52
60
<AsyncTestingNote/>
53
61
54
-
### 3. Kick off the build of 0.{minor}.0-rc.0
62
+
### 5. Kick off the build of 0.{minor}.0-rc.0
55
63
56
64
Once you're done with the testing, you can kick-off the bump and publishing of RC0:
57
65
@@ -78,7 +86,9 @@ Once you're done with the testing, you can kick-off the bump and publishing of R
### 4. Create a PR of the changelog using the generator
89
+
- Hermes artifacts will be uploaded to the [Maven repository](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/). It might take ~20 minutes for Maven to process them.
90
+
91
+
### 6. Create a PR of the changelog using the generator
82
92
83
93
To generate the changelog, we rely on a dedicated tool called [`@rnx-kit/rn-changelog-generator`](https://github.com/microsoft/rnx-kit/tree/main/incubator/rn-changelog-generator) that will parse the custom changelog messages that contributors write in their PRs.
84
94
@@ -109,33 +119,41 @@ For both these categories, we have to manually go through the listed commits and
109
119
- Commit which bumps dependencies should be **moved to the `Changed`** section
110
120
- For each dependency, there should be a single entry with the most recent bump. Commits that bumps the dependencies to lower versions can be **removed**
111
121
112
-
### 5. Create a GitHub Release
122
+
### 7. Create a GitHub Release
113
123
114
124
- Create a [GitHub Release](https://github.com/facebook/react-native/releases) with this template and **check "Pre-Release" checkbox**.
115
125
116
126
<GHReleasesNotesPrerelease />
117
127
118
-
### 6. Upload prebuilt Hermes binary
128
+
### 8. Upload prebuilt Hermes binary
119
129
120
130
In the `publish_release` CI workflow, the `build_hermes_macos` step produces a `tmp/hermes/output/hermes-runtime-darwin-vx.y.z.tar.gz` artifact, for example [here](https://app.circleci.com/pipelines/github/facebook/react-native/13933/workflows/5f2ad198-2264-4e7e-8c62-7b28e97532d8/jobs/262322/artifacts) are the artifacts for `0.69.0` release. Download it and attach it to the GitHub release.
121
131
122
-
### 7. Create a tracking discussion post
132
+
### 9. Create a tracking discussion post
123
133
124
134
Create a "Road to <YOUR_MINOR_VERSION>" discussion post in the [`react-native-releases`](https://github.com/reactwg/react-native-releases/discussions) working group:
125
135
126
136
<RoadToReleaseTemplate />
127
137
128
138
After creating it, make sure to link it in the relevant GitHub Release you created above, and to pin it in the discussion repo.
129
139
130
-
### 8. Verify that Upgrade Helper GitHub action has fired
140
+
### 10. Verify that Upgrade Helper GitHub action has fired
131
141
132
142
- You should see a [new publish job here](https://github.com/react-native-community/rn-diff-purge/actions).
133
143
- Once it has finished, you should be able to see that the [Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) presents the option to target the new RC0.
134
144
- If not, check out the guide on [how to update Upgrade Helper](/contributing/updating-upgrade-helper).
135
145
136
-
### 9. Broadcast that release candidate is out
146
+
### 11. Broadcast that release candidate is out
137
147
138
148
Once all the steps above have been completed, it's time to signal to the community that RC0 is available for testing! Do so in the following channels:
139
149
140
150
-[@reactnative](https://twitter.com/reactnative) on twitter
141
151
- RN Discord `#releases-coordination`
152
+
153
+
### 12. Bump minor version of all monorepo packages in `main`
154
+
155
+
The packages in the `react-native` monorepo must always be one minor version ahead of the latest or RC version (e.g. if you have cut `0.72-stable`, main needs to be in `0.73.x`. Once you're done with releasing the initial RC0, you should:
156
+
157
+
- Create a new branch in `react-native` from `main` in your own fork.
158
+
- Run `yarn bump-all-updated-packages --release-branch-cutoff` to bump the minor versions of all packages.
159
+
- Create a PR targeting `main` in `react-native` with the commit created by the previous command.
This page contains relevant information about how to update packages in the `react-native`[monorepo](https://github.com/react-native-community/discussions-and-proposals/pull/480).
7
+
8
+
## Finding all packages that have unpublished changes
9
+
10
+
#### Use case
11
+
12
+
1. You want to identify each package with unpublished (on npm) changes and update its version. This can be used in release cycle if you have merged some fixes to `*-stable` branch.
13
+
2. You want to force-bump each public package to the next minor version. This happens usually before release branch cutoff. In this case, please specify `release-branch-cutoff` argument before executing the script.
14
+
15
+
#### How to execute
16
+
17
+
`yarn bump-all-updated-packages` or `yarn bump-all-updated-packages --release-branch-cutoff`
18
+
19
+
#### Pseudocode
20
+
21
+
```
22
+
check that no git changes are present
23
+
24
+
for each package:
25
+
if package is private -> skip
26
+
27
+
if release-branch-cutoff argument is provided:
28
+
bump package version to the next minor
29
+
return
30
+
31
+
grep id of the last commit that changed package
32
+
grep id of the last commit that changed version of the package
33
+
34
+
if these ids are different:
35
+
bump package version (minor or patch)
36
+
37
+
align packages versions across whole monorepo
38
+
commit changes if required
39
+
```
40
+
41
+
### Notes
42
+
43
+
At the final step you will be asked if you want to commit all these changes. Always confirm committing if you want these packages to be published then on CircleCI, because the workflow that does this [will check that commit has a tag inside its message](https://github.com/facebook/react-native/wiki/Release-and-its-automated-processes#notes-1).
44
+
45
+
Updated versions will also be updated in packages consumers. This means if `@react-native/x` has `@react-native/y` as a dependency and we bump version of `@react-native/y`, then `@react-native/x` will have updated version of `@react-native/y` specified.
46
+
47
+
## Publishing an updated package to npm
48
+
49
+
We have a [CircleCI workflow](https://github.com/facebook/react-native/blob/292268ea3fa429cd1a1245b6239e0a85b59da02a/.circleci/config.yml#L1801-L1804), which runs **only on main or stable-\* branches**.
50
+
51
+
#### Pseudocode
52
+
53
+
```
54
+
for each package:
55
+
if last commit contains version change:
56
+
if this commit has specific message:
57
+
publish package to npm
58
+
```
59
+
60
+
#### Notes
61
+
62
+
This workflow explicitly checks that commit has a specific [tag](https://github.com/facebook/react-native/blob/main/scripts/monorepo/constants.js#L11) inside its message. This is used to prevent accidental publishes. To create such specific commit you should use [script from above](https://github.com/facebook/react-native/wiki/Release-and-its-automated-processes#finding-all-packages-that-have-unpublished-changes).
63
+
64
+
If you want to bump package version and publish it to npm registry, your version change should be exactly in the last commit. This is because of two things:
65
+
66
+
1. If multiple commits are merged to `main` branch at the same time, CircleCI will execute workflows only once on top of the latest commit.
67
+
2. To determine that version was changed we [evaluate the difference between HEAD and HEAD~1](https://github.com/facebook/react-native/blob/daeee2a6619db59391de3b7c6e08db0dbe2331aa/scripts/monorepo/find-and-publish-all-bumped-packages.js#L32-L35).
68
+
69
+
Example script output, where no package versions were changed:
70
+
<imgwidth="800"alt="Screenshot 2023-01-03 at 12 21 01"src="https://user-images.githubusercontent.com/28902667/210362611-97530b4d-0405-499c-9a3c-5542e069e929.png" />
71
+
72
+
## Align package versions across monorepo
73
+
74
+
> Side note: We do not anticipate that this script might be useful in future. With current monorepo setup, all packages versions should be updated and aligned by using `bump-all-updated-packages` script, both in `main` and `*-stable` branches.
75
+
76
+
#### Use case
77
+
78
+
You (or someone from release cycle team) want to verify that the latest versions of @react-native/\* packages are specified across monorepo, including `template`.
0 commit comments