Skip to content

Commit 0858300

Browse files
hramosfacebook-github-bot
authored andcommitted
Publish releases automatically, update docs (#19715)
Summary: Now that tests are green, we can return to automatic publishing to npm based on git tags. As long as all tests are passing, deploying a new release of React Native is as easy as tagging a commit. I've updated `Releases.md` to reflect today's release process. Future Work: Include information about updating the website, as this is no longer done automatically. Closes #19715 Differential Revision: D8429834 Pulled By: hramos fbshipit-source-id: 2c6f2c80ac43c4e6d20c01e06ba14a7e4b16180d
1 parent e8087ec commit 0858300

File tree

2 files changed

+45
-66
lines changed

2 files changed

+45
-66
lines changed

.circleci/config.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,20 @@ workflows:
652652
requires:
653653
- checkout_code
654654

655+
# Only runs on vX.X.X tags if all tests are green
656+
- publish_npm_package:
657+
filters:
658+
branches:
659+
ignore: /.*/
660+
tags:
661+
only: /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
662+
requires:
663+
- test_javascript
664+
- test_ios
665+
- test_tvos
666+
- test_end_to_end
667+
- analyze
668+
655669
# Only runs on PRs
656670
analyze:
657671
jobs:
@@ -665,17 +679,6 @@ workflows:
665679
requires:
666680
- checkout_code
667681

668-
# Only runs on NN-stable branches
669-
deploy:
670-
jobs:
671-
# If we are on a stable branch, wait for approval to deploy to npm
672-
- approve_publish_npm_package:
673-
filters: *filter-only-stable
674-
type: approval
675-
676-
- publish_npm_package:
677-
requires:
678-
- approve_publish_npm_package
679682

680683
# These tests are flaky or are yet to be fixed. They are placed on their own
681684
# workflow to avoid marking benign PRs as broken.

Releases.md

+31-55
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ React Native follows a monthly release train. Every month, a new branch created
1414
| 0.40.0 | 1st of December | 1st of January |
1515
| 0.41.0 | 1st of January | 1st of February |
1616
| 0.42.0 | 1st of February | 1st of March |
17-
| 0.43.0 | 1st of March | 1st of April |
18-
| 0.44.0 | 1st of April | 1st of May |
19-
| 0.45.0 | 1st of May | 1st of June |
20-
| 0.46.0 | 1st of June | 1st of July |
21-
| 0.47.0 | 1st of July | 1st of August |
22-
| 0.48.0 | 1st of August | 1st of September |
23-
| 0.49.0 | 1st of September | 1st of October |
24-
| 0.50.0 | 1st of October | 1st of November |
17+
| ... | ... | ... |
18+
| 0.56.0 | 1st of June | 1st of July |
19+
| 0.57.0 | 1st of July | 1st of August |
20+
| 0.58.0 | 1st of August | 1st of October |
2521
| ... | ... | ... |
2622

2723
-------------------
@@ -31,15 +27,16 @@ React Native follows a monthly release train. Every month, a new branch created
3127
### Prerequisites
3228

3329
The following are required for the local test suite to run:
30+
3431
- macOS with [Android dev environment set up](https://github.com/facebook/react-native/blob/master/ReactAndroid/README.md)
35-
- At least 0.2.0 [react-native-cli](https://www.npmjs.com/package/react-native-cli) installed globally
32+
- [react-native-cli](https://www.npmjs.com/package/react-native-cli) installed globally (v0.2.0 or newer)
3633

3734
### Step 1: Check everything works
3835

3936
Before cutting a release branch, make sure [Circle](https://circleci.com/gh/facebook/react-native) CI system is green.
4037

41-
4238
Before executing the following script, make sure you have:
39+
4340
- An Android emulator / Genymotion device running
4441
- No packager running in any of the projects
4542

@@ -57,18 +54,14 @@ Run:
5754

5855
```bash
5956
git checkout -b <version_you_are_releasing>-stable
60-
# e.g. git checkout -b 0.50-stable
57+
# e.g. git checkout -b 0.57-stable
6158

62-
./scripts/bump-oss-version.js <exact-version_you_are_releasing>
63-
# e.g. ./scripts/bump-oss-version.js 0.50.0-rc
64-
# You can use the --remote option to specify a Git remote other than the default "origin"
65-
git push --tags
66-
git push
59+
./scripts/bump-oss-version.js <exact_version_you_are_releasing>
60+
# e.g. ./scripts/bump-oss-version.js 0.57.0-rc.0
61+
# or ./scripts/bump-oss-version.js 0.58.0
6762
```
6863

69-
Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.50.0-rc`) and tag `next` meaning that this version will not be installed for users by default.
70-
71-
Go to [Circle CI](https://circleci.com/gh/facebook/react-native) and look for the build triggered by your push (e.g. _0.50-stable, [0.50.0] Bump version numbers_), then scroll down to the npm publish step to verify the package was published successfully (the build will be red if not).
64+
Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.57.0-rc.0`) and tag `next` meaning that this version will not be installed for users by default.
7265

7366
### Step 3: Write the release notes
7467

@@ -89,7 +82,9 @@ Sometimes commit messages might be really short / confusing - try rewording them
8982
- `Fix logging reported by RUN_JS_BUNDLE` -> `Fix systrace logging of RUN_JS_BUNDLE event`
9083
- `Fixes hot code reloading issue` -> `Fix an edge case in hot module reloading`
9184

92-
Before posting the list of changes, consider asking one of contributors for their opinion. Once everything is ready, post the release notes: https://github.com/facebook/react-native/releases
85+
Open a pull request against CHANGELOG.md at https://github.com/react-native-community/react-native-releases and ask for feedback.
86+
87+
Once everything is ready, create a new release at https://github.com/facebook/react-native/releases and link to the release notes.
9388

9489
**Important**: For release candidate releases, make sure to check "This is a pre-release".
9590

@@ -109,7 +104,7 @@ Now that the release is out in the open, go ahead and create a GitHub issue titl
109104

110105
-------------------
111106

112-
## How to release an RC update (e.g. 0.50.0-rc.1, 0.50.0-rc.2)
107+
## How to release an RC update (e.g. 0.57.0-rc.1, 0.57.0-rc.2)
113108

114109
The release is now in the open, people are finding bugs, and fixes have landed in master. People have been nominating fixes in the issue you created above. Use your best judgment to decide which commits merit an RC update. It's a good idea to do a new RC release when several small and non-risky bugs have been fixed. Having a few RC releases can also help people bisect in case we cherry-pick a bad commit by mistake.
115110

@@ -122,10 +117,10 @@ Follow these steps to check out the release branch:
122117

123118
```bash
124119
git checkout <version_you_are_patching>-stable
125-
# e.g. git checkout 0.50-stable
120+
# e.g. git checkout 0.57-stable
126121

127122
git pull origin <version_you_are_patching>-stable
128-
# e.g. git pull origin 0.50-stable
123+
# e.g. git pull origin 0.57-stable
129124
```
130125

131126
> If you don't have a local checkout of the release branch, you can run the following instead:
@@ -153,40 +148,31 @@ If everything worked, run the following to bump the version number:
153148

154149
```bash
155150
./scripts/bump-oss-version.js <exact_version_you_are_releasing>
156-
# e.g. ./scripts/bump-oss-version.js 0.50.0-rc.1
151+
# e.g. ./scripts/bump-oss-version.js 0.57.0-rc.1
157152
```
158153

159-
### Step 5: Push to GitHub
160-
161-
Finally, push the new tags and commits to GitHub:
162-
163-
```
164-
git push --tags
165-
git push
166-
````
154+
Again, Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.57.0-rc.1`).
167155

168-
Again, Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.50.0-rc.1`).
169-
170-
### Step 6: Update the release notes
156+
### Step 5: Update the release notes
171157

172-
Go to https://github.com/facebook/react-native/releases and find the release notes for this release candidate. Edit them so that they now point to the tag that you've just created. We want single release notes per version. For example, if there is v0.50.0-rc and you just released v0.50.0-rc.1, the release notes should live on the v0.50.0-rc.1 tag at https://github.com/facebook/react-native/tags
158+
Go to https://github.com/facebook/react-native/releases and find the release notes for this release candidate. Edit them so that they now point to the tag that you've just created. We want single release notes per version. For example, if there is v0.57.0-rc and you just released v0.57.0-rc.1, the release notes should live on the v0.57.0-rc.1 tag at https://github.com/facebook/react-native/tags
173159

174160
-------------------
175161

176-
## How to do the final stable release (e.g. 0.50.0, 0.50.1)
162+
## How to do the final stable release (e.g. 0.57.0, 0.57.1)
177163

178164
A stable release is promoted roughly a month after the release branch is cut (refer to the schedule above). The release may be delayed for several reasons, including major issues in the release candidate. Make sure that all bug fixes that have been nominated in your tracking issue have been addressed as needed. Avoid cherry-picking commits that have not been vetted in the release candidate phase at this point.
179165

180-
Once you are sure that the release is solid, perform the following steps. Note that they're similar to the steps you may have followed earlier when patching the release candidate, but we're not cherry-picking any additional commits at this point.
166+
Once you are sure that the release is solid, perform the following steps. Note that they're similar to the steps you may have followed earlier when patching the release candidate, but we're not cherry-picking any additional commits at this point.
181167

182168
### Step 1: Check out the release branch
183169

184170
```bash
185171
git checkout <version_you_are_patching>-stable
186-
# e.g. git checkout 0.50-stable
172+
# e.g. git checkout 0.57-stable
187173

188174
git pull origin <version_you_are_patching>-stable
189-
# e.g. git pull origin 0.50-stable
175+
# e.g. git pull origin 0.57-stable
190176
```
191177

192178
> If you don't have a local checkout of the release branch, you can run the following instead:
@@ -206,28 +192,18 @@ If everything worked:
206192

207193
```bash
208194
./scripts/bump-oss-version.js <exact_version_you_are_releasing>
209-
# e.g. ./scripts/bump-oss-version.js 0.50.0
210-
```
211-
212-
### Step 4: Push to GitHub
213-
214-
Finally, push the new tags and commits to GitHub:
215-
216-
```
217-
git push --tags
218-
git push
195+
# e.g. ./scripts/bump-oss-version.js 0.57.0
219196
```
220197

221-
As with the release candidate, Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.50.0`).
198+
As with the release candidate, Circle CI will automatically run the tests and publish to npm with the version you have specified (e.g `0.57.0`).
222199

223-
Go to [Circle CI](https://circleci.com/gh/facebook/react-native) and look for the build triggered by your push (e.g. _0.50-stable, [0.50.0] Bump version numbers_), then scroll down to the npm publish step to verify the package was published successfully (the build will be red if not).
200+
Go to [Circle CI](https://circleci.com/gh/facebook/react-native) and look for the build triggered by your push (e.g. _0.57-stable, [0.57.0] Bump version numbers_), then scroll down to the npm publish step to verify the package was published successfully (the build will be red if not).
224201

225202
This will now become the latest release, and will be installed by users by default. At this point, the website will be updated and the docs for this release will be displayed by default.
226203

227-
### Step 5: Update the release notes
204+
### Step 4: Update the release notes
228205

229-
Once you see that the website is displaying the version that you have just created, you will need to update the release notes. Move the release notes from the release candidate, to the tag that you've just created. We want single release notes per version. For example, if there is v0.50.0-rc and later we release v0.50.0, the release notes should live on v0.50.0:
230-
https://github.com/facebook/react-native/tags
206+
Go to https://github.com/facebook/react-native/releases and find the release notes for this release candidate. Edit them so that they now point to the tag that you've just created. We want single release notes per version. For example, if there is v0.57.0 and you just released v0.57.1, the release notes should live on the v0.57.1 tag at https://github.com/facebook/react-native/tags
231207

232208
For non-RC releases: Uncheck the box "This is a pre-release" and publish the notes.
233209

0 commit comments

Comments
 (0)