Update CircleCI to auto-deploy release branch on push

Summary:
Changelog: [Internal] Update CircleCI to auto-deploy release branch on push

This work is part of an effort to automate the release process by using a push to a release branch as a trigger to prepare, package and deploy react-native to npm from CircleCI

The following diagram describes the context (what kind of releases we do, relevant scripts and what they do), the pre-existing process for the different types of release and how I've modified the process.
{F683387103}

This diff updates the relevant CircleCI workflows

Reviewed By: sota000

Differential Revision: D32702420

fbshipit-source-id: e20cdeb53eb4a8ce7e54e083e3e14bd89e11b789
This commit is contained in:
Luna Wei
2021-11-30 16:48:47 -08:00
committed by Facebook GitHub Bot
parent f4314c2b44
commit 94abcffe2f
2 changed files with 21 additions and 4 deletions
+20 -1
View File
@@ -749,6 +749,17 @@ jobs:
# -------------------------
# JOBS: Releases
# -------------------------
prepare_package_for_release:
executor: reactnativeios
steps:
- add_ssh_keys:
fingerprints:
- "1c:98:e0:3a:52:79:95:29:12:cd:b4:87:5b:41:e2:bb"
- run:
name: "Set new react-native version and commit changes"
command: |
node ./scripts/prepare-package-for-release.js
build_npm_package:
parameters:
publish_npm_args:
@@ -847,7 +858,6 @@ workflows:
only:
- main
- /^pull\/.*$/
- /^(\d+)\.(\d+)-stable$/
- test_js:
run_disabled_tests: false
filters:
@@ -915,6 +925,15 @@ workflows:
releases:
jobs:
# This job will trigger on pushes to release branch and commit a version tag to trigger `build_npm_package` for release
- prepare_package_for_release:
name: prepare_package_for_release
filters:
branches:
only:
- /^(\d+)\.(\d+)-stable$/
# This job will trigger when a version tag is pushed (by prepare_package_for_release)
- build_npm_package:
name: build_and_publish_npm_package
context: react-native-bot
+1 -3
View File
@@ -116,9 +116,7 @@ if (dryRunBuild) {
// For stable, pre-release releases, we manually call bump-oss-version on release branch
if (nightlyBuild || dryRunBuild) {
if (
exec(
`node scripts/bump-oss-version.js --nightly --to-version ${releaseVersion}`,
).code
exec(`node scripts/set-rn-version.js --to-version ${releaseVersion}`).code
) {
echo('Failed to bump version number');
exit(1);