Skip to content

Commit

Permalink
Fix new release workflow script (facebook#43530)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#43530

Fixes and changes following D54956345, encountered during the release process for 0.74 RC4 today.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55017872

fbshipit-source-id: 616b387088db00c6f076f4571b4ab1541467361c
  • Loading branch information
huntie authored and facebook-github-bot committed Mar 18, 2024
1 parent 6dd0cc9 commit a87fb56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
10 changes: 2 additions & 8 deletions .circleci/configurations/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,18 +1142,12 @@ jobs:
name: Versioning react-native package
command: |
node scripts/releases/set-rn-version.js -v "<< parameters.version >>" --build-type "release"
- run:
name: Updating RNTester Podfile.lock
command: |
cd packages/rn-tester/
bundle install
bundle exec pod install
- run:
name: Creating release commit
command: |
git commit -a -m "Release << parameters.version >>\n\n#publish-packages-to-npm&<< parameters.tag >>"
git commit -a -m "Release << parameters.version >>" -m "#publish-packages-to-npm&<< parameters.tag >>"
git tag -a "v<< parameters.version >>" -m "v<< parameters.version >>"
git show HEAD
GIT_PAGER=cat git show HEAD
- when:
condition:
equal: ["latest", << parameters.tag >>]
Expand Down
20 changes: 10 additions & 10 deletions scripts/releases-local/trigger-react-native-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ async function exitIfUnreleasedPackages() {
* value will be used instead, setting all packages to a single version.
*/
async function getNextMonorepoPackagesVersion() /*: Promise<string | null> */ {
// Based on @react-native/dev-middleware@0.74.5
const _0_74_MIN_PATCH = 6;
// Based on last publish before this strategy
const _0_74_MIN_PATCH = 75;

const packages = await getPackages({
includeReactNative: false,
Expand All @@ -149,8 +149,8 @@ async function getNextMonorepoPackagesVersion() /*: Promise<string | null> */ {
return null;
}

const {minor} = parseVersion(version, 'release');
patchVersion = Math.max(patchVersion, parseInt(minor, 10) + 1);
const {patch} = parseVersion(version, 'release');
patchVersion = Math.max(patchVersion, parseInt(patch, 10) + 1);
}

return '0.74.' + patchVersion;
Expand Down Expand Up @@ -185,7 +185,7 @@ async function main() {
}

// $FlowFixMe[prop-missing]
const useNewWorkflow: boolean = argv.useNewWorkflow;
const useNewWorkflow /*: boolean */ = argv.useNewWorkflow;

// now check for unreleased packages
if (!useNewWorkflow) {
Expand Down Expand Up @@ -258,18 +258,18 @@ async function main() {

const parameters = useNewWorkflow
? {
release_version: version,
release_latest: latest,
run_release_workflow: true,
}
: {
run_new_release_workflow: true,
release_version: version,
release_tag: npmTag,
// NOTE: Necessary for 0.74, should be dropped for 0.75+
release_monorepo_packages_version: nextMonorepoPackagesVersion,
// $FlowFixMe[prop-missing]
release_dry_run: argv.dryRun,
}
: {
release_version: version,
release_latest: latest,
run_release_workflow: true,
};

const options = {
Expand Down

0 comments on commit a87fb56

Please sign in to comment.