Commit Graph

13 Commits

Author SHA1 Message Date
Nicola Corti
773a02ad5d Fix wrong command for publishing of external-artifacts (#46417)
Summary:
This is a pick on main of a fix necessary to release 0.76.x

## Changelog:

[INTERNAL] - Fix wrong command for publishing of external-artifacts

Pull Request resolved: https://github.com/facebook/react-native/pull/46417

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D62440193

Pulled By: cortinico

fbshipit-source-id: 57ea0736c1b6e3e60b048a46770356901de74024
2024-09-10 07:11:42 -07:00
Nicola Corti
8d0cbbf0e6 Make build_android publish to the staging repositories (#45468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45468

This should greatly reduce the time spent on build_npm_package
because we're moving all the publishing logic to build_android.

I need to do a bit more testing with nightlies to make sure that everything is published correctly.

Changelog:
[Internal] [Changed] - Make build_android publish to the stating repositories

Reviewed By: cipolleschi

Differential Revision: D59804015

fbshipit-source-id: be3f0b6e16f5fdbf760ec7a5e16c8e258e06dd28
2024-07-16 13:58:43 -07:00
Alex Hunt
5f60ad65ca Rename set-rn-version script, mark as deprecated (#45184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45184

This is a follow-up to D59055522.

> NOTE:This diff will be followed up by a merge of the set-rn-version script into set-version. (I had considered a rename to version-rn-artifacts, intentionally keeping this script separate and distinct from a future [lerna version + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)

- Rename `set-rn-version` to `set-rn-artifacts-version` (more accurate).
- Mark this script as deprecated.
    - For now, there are too many references to this script in CI test jobs to refactor away this entry point, so I am avoiding this — these should later be standardised to `set-version`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D59058085

fbshipit-source-id: 4123ac73b5c7a2e07a1d1b6da61e0ad94fc31f84
2024-06-26 10:14:12 -07:00
Alex Hunt
4a6b889e93 Move all package.json updates into set-version script (#45180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45180

- Simplifies the responsibilities of `scripts/releases/set-rn-version.js`.
    - This no longer modifies `packages/react-native/package.json`, delegating this to `set-version`.
- Simplifies logic in `set-version`, **fixing behaviour** against deps in `packages/react-native/package.json`.
- This also acts as cleanup since D58469912 (template removal) — removing the unreferenced `update-template-package.js` util.

NOTE: This diff will be followed up by a merge of the `set-rn-version` script into `set-version`. (I had considered a rename to `version-rn-artifacts`, intentionally keeping this script separate and distinct from a future [`lerna version` + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D59055522

fbshipit-source-id: 79b937f9e0ac790512b180ab4147aefef7f5202c
2024-06-26 07:59:49 -07:00
Luna Wei
fadcf7bf83 set to public access by default
Summary: Changelog: [Internal] - Specify `access` flag in publishing nightlies

Reviewed By: cipolleschi

Differential Revision: D54230208

fbshipit-source-id: 7711eee62e8e01a12d6604831754d36a5cd5dc13
2024-02-27 09:09:50 -08:00
Alex Hunt
d6bf51cad9 Refactor remaining forEachPackage call sites (#43112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43112

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53942028

fbshipit-source-id: 335bff3c3a31026bae7140fac1d1a6aae23a0f1e
2024-02-20 09:55:46 -08:00
Alex Hunt
80ec096e7c Create shared consts module for scripts
Summary:
Tidy up, removes risk of breakage when relocating inner modules.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53813025

fbshipit-source-id: 43dc4a57191363546d6858cff311e260d416192f
2024-02-16 03:21:25 -08:00
Luna Wei
d6a440ee8b Remove process.exit calls from publish-npm and throw errors instead (#43039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43039

Changelog: [Internal] - `publish-npm.js` is a [script we call in our CI](https://www.internalfb.com/code/fbsource/[c0b8566ac0d66c2c0282eeb597bfb54bedf757c6]/xplat/js/react-native-github/.circleci/configurations/jobs.yml?lines=1243) to publish the react-native package and others.

Currently, the script leverages `exit/process.exit` to terminate early in a couple of places which makes the code hard to test because our tests don't truly early exit when `exit/process.exit` is called.

This change removes any explicit `exit` calls and instead leverages the uncaught error to terminate the process and set the non-zero exit code. This makes our tests more accurate to the real control flow of the script.

I've also updated the tests to better capture what we're actually testing by mocking at a higher level.

Reviewed By: cipolleschi

Differential Revision: D53792754

fbshipit-source-id: 9293bb9a95430c50052db36c0e6f6c1ba348107f
2024-02-15 11:18:05 -08:00
Luna Wei
b8ad91732f fix nightlies dont exit early (#43035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43035

Changelog: [Internal] - We early-exited because of poor copy-pasta and the fact that our tests don't properly emulate the behavior of mock `exit`

Will try and clean this up in next diff but want to quickly fix so it unbreaks nightlies

Reviewed By: yungsters

Differential Revision: D53779109

fbshipit-source-id: ff56e498344fcb4851729d98625b6c7010c73795
2024-02-14 14:32:21 -08:00
Luna Wei
23a66444f7 Fix nightly publish
Summary:
Changelog: [Internal] - `get-and-update-packages` was deleted in D53487874 also actually published the monorepo packages.

Update publish-npm to publish the updated nightly monorepo packages

Reviewed By: cipolleschi

Differential Revision: D53697621

fbshipit-source-id: 21facb49739ba64c43b921117356715be3d8868a
2024-02-13 12:21:20 -08:00
Luna Wei
8a94bf0dba Fix CircleCI template tests by excluding dry-run build types
Summary:
Changelog: [Internal] - We still use the `dry-run` build variant in template tests on CircleCI

Previous diff migrated `set-rn-version` to `set-version` for dry-run, prealpha, and nightly build types. I didn't realize that template test flow used `dry-run` builds. I thought it was just for commitlies (which are deprecated).

To properly migrate this site, I need to fix the template test flow to accept monorepo packages at the same version as the dry-run react-native version (1000-<commithash>)

For now, let's just make this change more precise, and only update the nightly flow

See this error: {F1455663616}

Template test flow doesn't fake publish the monorepo packages at this version -- they're still using the versions off of main

Reviewed By: mdvacca

Differential Revision: D53688238

fbshipit-source-id: 6b64baca7eac842f2207fe13a3046b18459228da
2024-02-12 18:42:26 -08:00
Luna Wei
34abd79475 Use set-version for nightly publishes (#42903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42903

Changelog: [Internal] - Update publish-npm to use `set-version` for nightly builds

Now that `set-version` basically does what `set-rn-version` does, this diff uses this logic for nightlies only (as dry-run/pre-alpha variants are non-functional right now)

This does not change the flow of build-type `'release'` -- that will still use `set-rn-version` via CircleCI ([job](https://fburl.com/code/6xo3ijwg), [script](https://fburl.com/code/bo8np0tb))  We will eventually replace that too but that will be later.

This allows us to delete `get-and-update-packages.js` which was a helper written specifically for updating monorepo packages for nightlies.

The purpose of this is to eventually conform all version updates to use `set-version` in all types of releases (nightlies, stable)

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D53487874

fbshipit-source-id: 734b528ef5bd095ac68f86701ae105daa30c7d68
2024-02-12 12:07:51 -08:00
Alex Hunt
76598de621 Reorganise and document release script entry points (#42774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42774

Reorganise release scripts so that command entry points are grouped based on execution context, which also reflects dependencies between scripts.

Also:

- Document the current behaviours of these scripts.
- Relocate utils out of the root contents.
- Replace `exec` call to `set-rn-version` script with function import.

NOTE: `yarn trigger-react-native-release` (documented command in release process) is unchanged, since this is aliased from `package.json`.

```
├── releases
│   ├── templates/
│   ├── utils/
│   ├── remove-new-arch-flags.js
│   ├── set-rn-version.js
│   └── update-template-package.js
├── releases-ci
│   ├── prepare-package-for-release.js
│   └── publish-npm.js
└── releases-local
    └── trigger-react-native-release.js
```

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53274341

fbshipit-source-id: eec2befc43e7a47fd821b2e2bcc818ddffbb6cf7
2024-02-01 06:02:17 -08:00