Skip to content

Commit 94abcff

Browse files
Luna Weifacebook-github-bot
authored andcommitted
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
1 parent f4314c2 commit 94abcff

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.circleci/config.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,17 @@ jobs:
749749
# -------------------------
750750
# JOBS: Releases
751751
# -------------------------
752+
prepare_package_for_release:
753+
executor: reactnativeios
754+
steps:
755+
- add_ssh_keys:
756+
fingerprints:
757+
- "1c:98:e0:3a:52:79:95:29:12:cd:b4:87:5b:41:e2:bb"
758+
- run:
759+
name: "Set new react-native version and commit changes"
760+
command: |
761+
node ./scripts/prepare-package-for-release.js
762+
752763
build_npm_package:
753764
parameters:
754765
publish_npm_args:
@@ -847,7 +858,6 @@ workflows:
847858
only:
848859
- main
849860
- /^pull\/.*$/
850-
- /^(\d+)\.(\d+)-stable$/
851861
- test_js:
852862
run_disabled_tests: false
853863
filters:
@@ -915,6 +925,15 @@ workflows:
915925

916926
releases:
917927
jobs:
928+
# This job will trigger on pushes to release branch and commit a version tag to trigger `build_npm_package` for release
929+
- prepare_package_for_release:
930+
name: prepare_package_for_release
931+
filters:
932+
branches:
933+
only:
934+
- /^(\d+)\.(\d+)-stable$/
935+
936+
# This job will trigger when a version tag is pushed (by prepare_package_for_release)
918937
- build_npm_package:
919938
name: build_and_publish_npm_package
920939
context: react-native-bot

scripts/publish-npm.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ if (dryRunBuild) {
116116
// For stable, pre-release releases, we manually call bump-oss-version on release branch
117117
if (nightlyBuild || dryRunBuild) {
118118
if (
119-
exec(
120-
`node scripts/bump-oss-version.js --nightly --to-version ${releaseVersion}`,
121-
).code
119+
exec(`node scripts/set-rn-version.js --to-version ${releaseVersion}`).code
122120
) {
123121
echo('Failed to bump version number');
124122
exit(1);

0 commit comments

Comments
 (0)