microsoft / react-native-macos

A framework for building native macOS apps with React.
https://microsoft.github.io/react-native-windows/
MIT License
3.56k stars 138 forks source link

ci(0.76): Make sure to build codegen and update the lockfile before publish #2264

Closed Saadnajmi closed 3 weeks ago

Saadnajmi commented 3 weeks ago

Summary:

Our publish pipeline called set-version.js, which would change version numbers in package.json files. This invalidated our yarn.lock file. Then, npm publish would calls the lifecycle script pack , which calls prepack, which Meta defined to run packages/react-native/scripts/prepack.js. This will build react-native-codegen if it hasn't been (I guess we want the build output packed) and run yarn install. In CI, yarn install is by default immutable. However, as I pointed out above, our yarn.lock is invalidated, so yarn install --immutable will fail because we need to update the lock file.

So.. let's fix this by building codeine and mutably running yarn install. Also, we don't need to call the publish-npm script anymore methinks. We're doing it in our pipeline separately anyway.

Test Plan:

Did my best to locally reproduce and test.. but testing publish sucks.