Skip to content

Commit 791012b

Browse files
Saadnajmitido64
andauthored
ci: update yarn.lock as part of nx release (#2426)
## Summary: `nx release` will bump local packages that are referenced in our lock file, thus invalidating the lock file till we run `yarn install` again. Let's run `yarn install` as part of our generator ## Test Plan: Tested by cherry picking this commit to a local `0.77-stable` branch, creating a version plan, and running `nx release --dry-run`. `yarn install` was run. --------- Co-authored-by: Tommy Nguyen <[email protected]>
1 parent 555a19c commit 791012b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/nx-release-version/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const { releaseVersionGenerator } = require('@nx/js/src/generators/release-version/release-version');
44
const fs = require('node:fs');
55
const path = require('node:path');
6+
const { spawnSync } = require('node:child_process');
67

78
async function runSetVersion() {
89
const rnmPkgJson = require.resolve('react-native-macos/package.json');
@@ -14,6 +15,8 @@ async function runSetVersion() {
1415

1516
await updateReactNativeArtifacts(version);
1617

18+
spawnSync('yarn', ['install', '--mode', 'update-lockfile']);
19+
1720
return [
1821
path.join(
1922
REPO_ROOT,
@@ -60,6 +63,10 @@ async function runSetVersion() {
6063
'Core',
6164
'ReactNativeVersion.js',
6265
),
66+
path.join(
67+
REPO_ROOT,
68+
'yarn.lock',
69+
),
6370
];
6471
}
6572

0 commit comments

Comments
 (0)