Skip to content

Commit d9c595e

Browse files
authored
Revise Hermes release guide for React Native versions (#1162)
1 parent c25bf73 commit d9c595e

File tree

1 file changed

+140
-7
lines changed

1 file changed

+140
-7
lines changed

docs/guide-hermes-release.md

Lines changed: 140 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@
55
66
Prerequisites: You'll need access to the [Hermes repo](https://github.com/facebook/hermes). You can give yourself permission via the Meta Internal OSS dashboard.
77

8-
## Step 1: Check-out or create the Hermes release branch
8+
See the guide you need, based on the React native release you are running:
9+
- [React Native >= 0.83](#for-react-native--083)
10+
- [React Native < 0.82](#for-react-native--082)
911

10-
### If you are cutting a release candidate
12+
## For React Native >= 0.83
13+
14+
Starting from React Native 0.83, we need to have two tags for Hermes:
15+
- A tag for the (legacy) Hermes
16+
- A tag for HermesV1
17+
18+
We decoupled the build of Hermes from the React Native repository and we can now consume Hermes binaries that are produced in the Hermes repository
19+
20+
### Step 1: Check-out or create the (Legacy) Hermes release branch
21+
22+
#### If you are cutting a release candidate
1123
Create a Hermes release branch of the form `rn/<major>.<minor>-stable` from latest `main`.
1224

1325
Make sure your branch is pushed to the remote.
@@ -20,14 +32,135 @@ git checkout -b rn/0.76-stable
2032
git push origin HEAD
2133
```
2234

23-
### For stable patch releases
35+
### Step 2: Cherry-pick
36+
37+
#### For (Legacy) Hermes
38+
39+
> [!Important]
40+
> If you cutting a release candidate, skip this step
41+
42+
1. Pick the relevant commits onto that branch. The pick requests should be from `main` and no other branch on Hermes.
43+
2. Push the picks to the remote branch.
44+
45+
#### For HermesV1
46+
47+
> [!Important]
48+
> If you cutting a release candidate, skip this step
49+
50+
1. Checkout the `250829098.0.0-stable` branch.
51+
2. Pick the relevant commits onto that branch. The pick requests should be from `static_h` and no other branch on Hermes.
52+
3. Push the picks to the remote branch.
53+
54+
> [!Important]
55+
> If you cherry picked something, you need to bump the patch version of hermes, as shown in [this commit](https://github.com/facebook/hermes/commit/ddd708a85b164d1841c024973d0f6d3fad60a4c2)
56+
> 1. Open the [`npm/hermes-compiler/package.json`](https://github.com/facebook/hermes/blob/ddd708a85b164d1841c024973d0f6d3fad60a4c2/npm/hermes-compiler/package.json) file
57+
> 2. Bump the patch number by 1
58+
> 3. Commit and push.
59+
60+
### Step 3: Bump hermes-compiler versions
61+
62+
> [!Important]
63+
> This step is required only if
64+
> - we cherry-picked something in one of the branches
65+
66+
Hermes is now publishing the [`hermes-compiler`](https://www.npmjs.com/package/hermes-compiler) package on NPM to release the hermes-compiler as a seprate npm package.
67+
You have to update the versions for both Legacy Hermes.
68+
69+
#### For Legacy Hermes
70+
71+
From the release branch (e.g.: `rn/0.83.0-stable`):
72+
1. Open the [`npm/hermes-compiler/package.json`](https://github.com/facebook/hermes/blob/ddd708a85b164d1841c024973d0f6d3fad60a4c2/npm/hermes-compiler/package.json) file
73+
2. Bump the **patch** number by 1
74+
3. Commit and push.
75+
76+
### Step 4: Build Hermes and Publish Tag
77+
78+
Navigate to the [RN Build Hermes](https://github.com/facebook/hermes/actions/workflows/rn-build-hermes.yml) and run the workflow twice.
79+
This workflow:
80+
- builds the Hermes artifacts;
81+
- publishes them on maven;
82+
- publishes the hermes-compiler to NPM;
83+
- publish the tag on GitHub
84+
85+
The tag will be created as last step, and we need to wait for the whole process to end before React Native can start the Release.
86+
87+
#### For (Legacy) Hermes
88+
89+
1. Set the branch to the release branch (e.g.: rn/0.83-stable)
90+
2. Set the release type as `Release`
91+
92+
#### For Hermes V1
93+
94+
1. Set the branch to the Hermes V1 release branch: `250829098.0.0-stable`
95+
2. Set the release type as `Release`
96+
97+
### Step 5: Bump the Hermes version on the React Native release branch
98+
99+
Using the newly generated Hermes tag run the following script on the React Native release branch:
100+
101+
```bash
102+
# Replace <the_hermes_tag> with the tag that will look like 'hermes-2022-07-20-RNv0.70.0-bc97c5399e0789c0a323f8e1431986e207a9e8ba'
103+
./packages/react-native/scripts/hermes/bump-hermes-version.js -t <the_hermes_tag> -s <the_hermes_v1_tag>
104+
```
105+
106+
An example of the invocation is:
107+
```
108+
./packages/react-native/scripts/hermes/bump-hermes-version.js -t v0.14.0 -s v250829098.0.2
109+
```
110+
111+
> [!Note]
112+
> The script also support the `-h` parameter to specify the legacy Hermes version and the `-v` parameter to specify the Hermes V1 version.
113+
> When not passed, the script will check the latest version of hermes published on NPM and will prompt for confirmation.
114+
115+
Add and commit the extra files that got created at:
116+
- packages/react-native/sdks/.hermesversion
117+
- packages/react-native/sdks/.hermesV1version
118+
and updated at:
119+
- packages/react-native/sdks/hermes-engine/version.properties
120+
- packages/react-native/package.json
121+
122+
Now you can continue with the rest of your React Native release.
123+
124+
```
125+
git add packages/react-native/sdks/.hermesvesion packages/react-native/sdks/.hermesv1vesion packages/react-native/sdks/hermes-engine/version.properties
126+
git commit -m "Bump hermes version"
127+
```
128+
129+
### Step 5: [Only for Branch Cut] Bump version on `main` and Hermes v1 release branch
130+
131+
The `main` branch and the `250829098.0.0-stable` should always track the next version that we are going to release.
132+
133+
After the build started and the tag is generated, bump the hermes-compiler versions on those branches:
134+
135+
#### For Legacy Hermes
136+
137+
From the `main` branch:
138+
1. Create a separate branch `<username>/bump-hermes-compiler-to-0.X.0` (replace `<username>` and `X` with your gh username and the next minor version of Hermes)
139+
1. Open the [`npm/hermes-compiler/package.json`](https://github.com/facebook/hermes/blob/ddd708a85b164d1841c024973d0f6d3fad60a4c2/npm/hermes-compiler/package.json) file
140+
2. Bump the **minor** number by 1
141+
3. Commit and push.
142+
4. Open a PR on the Hermes repository
143+
5. Import and land it.
144+
145+
#### For Hermes V1
146+
147+
From the `250829098.0.0-stable` branch
148+
1. Open the [`npm/hermes-compiler/package.json`](https://github.com/facebook/hermes/blob/ddd708a85b164d1841c024973d0f6d3fad60a4c2/npm/hermes-compiler/package.json) file
149+
2. Bump the **patch** number by 1
150+
3. Commit and push.
151+
152+
---
153+
154+
## For React Native < 0.82
155+
156+
### Step 1: Check-out the Hermes release branch
24157

25158
Check out the Hermes release branch for your minor. It should be of the form `rn/<major>.<minor>-stable`.
26159

27160
> [!Tip]
28161
> If one doesn't exist and you are not releasing a release candidate, use the [latest tag](https://github.com/facebook/hermes/tags) for your minor. Check out that tag, and create the branch of the form `rn/<major>.<minor>-stable`. We should be creating these during release candidate cuts.
29162
30-
## Step 2: Cherry-pick
163+
### Step 2: Cherry-pick
31164

32165
> [!Important]
33166
> If you cutting a release candidate, skip this step
@@ -36,9 +169,9 @@ Pick the relevant commits onto that branch. The pick requests should be from `ma
36169

37170
Push the picks to the remote branch.
38171

39-
## Step 3: Publish Tag
172+
### Step 3: Publish Tag
40173

41-
Head to the [Publish Tag workflow](https://github.com/facebook/hermes/actions/workflows/create-tag.yml) in the Hermes repo.
174+
Head to the [Publish Tag workflow](https://github.com/facebook/hermes/actions/workflows/create-tag-legacy.yml) in the Hermes repo.
42175

43176
Click the "Run Workflow" button. Run the workflow from `main`, input the React Native version you are releasing (e.g. 0.82.0, 0.82.1, etc), and the SHA of the head of your Hermes release branch.
44177

@@ -58,7 +191,7 @@ Using the newly generated Hermes tag run the following script on the React Nativ
58191
./packages/react-native/scripts/hermes/bump-hermes-version.js -t <the_hermes_tag>
59192
```
60193

61-
Add and commit the extra file that got created at packages/react-native/sdks/hermes/.hermesversion. Now you can continue with the rest of your React Native release.
194+
Add and commit the extra file that got created at `packages/react-native/sdks/hermes/.hermesversion`. Now you can continue with the rest of your React Native release.
62195

63196
```
64197
git add packages/react-native/sdks/.hermesvesion && git commit -m "Bump hermes version"

0 commit comments

Comments
 (0)