Skip to content

Commit 40a4df0

Browse files
committed
Fix RNTester Podfile.lock update in release workflow (facebook#43513)
Summary: Pull Request resolved: facebook#43513 The previous `update_podfile_lock.sh` script would fail as executed from the repo root (could not locate RNTester dir). Delete this and replace with direct calls in `prepare-package-for-release.js`, which will fail script on error. {F1469216632} Changelog: [Internal] Reviewed By: cortinico Differential Revision: D54949214 fbshipit-source-id: 4f032069e803e84f835c279d01332d16787dfafc
1 parent ff5d87d commit 40a4df0

File tree

3 files changed

+27
-32
lines changed

3 files changed

+27
-32
lines changed

scripts/consts.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@ const REACT_NATIVE_PACKAGE_DIR /*: string */ = path.join(
3636
'react-native',
3737
);
3838

39+
/**
40+
* The absolute path to the rn-tester package.
41+
*/
42+
const RN_TESTER_DIR /*: string */ = path.join(
43+
REPO_ROOT,
44+
'packages',
45+
'rn-tester',
46+
);
47+
3948
module.exports = {
4049
PACKAGES_DIR,
4150
REACT_NATIVE_PACKAGE_DIR,
4251
REPO_ROOT,
52+
RN_TESTER_DIR,
4353
SCRIPTS_DIR,
4454
};

scripts/releases-ci/prepare-package-for-release.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
'use strict';
1313

14+
const {RN_TESTER_DIR} = require('../consts');
1415
const {setReactNativeVersion} = require('../releases/set-rn-version');
1516
const {failIfTagExists} = require('../releases/utils/release-utils');
1617
const {
1718
isReleaseBranch,
1819
parseVersion,
1920
} = require('../releases/utils/version-utils');
21+
const {execSync} = require('child_process');
2022
const {echo, exec, exit} = require('shelljs');
2123
const yargs = require('yargs');
2224

@@ -95,11 +97,21 @@ async function main() {
9597
}
9698

9799
// Release builds should commit the version bumps, and create tags.
98-
echo('Updating RNTester Podfile.lock...');
99-
if (exec('source scripts/update_podfile_lock.sh && update_pods').code) {
100-
echo('Failed to update RNTester Podfile.lock.');
101-
echo('Fix the issue, revert and try again.');
102-
exit(1);
100+
try {
101+
console.log('Updating RNTester Podfile.lock');
102+
execSync(
103+
`
104+
bundle install;
105+
bundle exec pod install;
106+
`,
107+
{cwd: RN_TESTER_DIR, stdio: 'inherit'},
108+
);
109+
} catch (e) {
110+
console.error('Failed to update RNTester Podfile.lock.');
111+
console.error('Fix the issue, revert and try again.');
112+
113+
process.exitCode = 1;
114+
return;
103115
}
104116

105117
echo(`Local checkout has been prepared for release version ${version}.`);

scripts/update_podfile_lock.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)