16 Commits

Author SHA1 Message Date
Salman Muin Kayser Chishti
b9ac40876e chore(ci): update GitHub Actions to latest versions with Node.js 24 support (#54885)
Summary:
Updates all `actions/*` GitHub Actions to their latest versions to ensure compatibility with Node.js 24 and prepare for the [deprecation of Node.js 20 on GitHub Actions runners](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/).

## Changelog:

[Internal] [Changed] - Updated GitHub Actions to latest versions with Node.js 24 support

## Version Updates

| Action | Previous | Current | Release Notes |
|--------|----------|---------|---------------|
| `actions/checkout` | v4 | **v6** | [v6.0.0](https://github.com/actions/checkout/releases/tag/v6.0.0) |
| `actions/github-script` | v6 | **v8** | [v8.0.0](https://github.com/actions/github-script/releases/tag/v8.0.0) |
| `actions/setup-node` | v4 | **v6** | [v6.0.0](https://github.com/actions/setup-node/releases/tag/v6.0.0) |
| `actions/setup-java` | v2/v4 | **v5** | [v5.0.0](https://github.com/actions/setup-java/releases/tag/v5.0.0) |
| `actions/upload-artifact` | v4/v4.3.4 | **v6** | [v6.0.0](https://github.com/actions/upload-artifact/releases/tag/v6.0.0) |
| `actions/download-artifact` | v4/v4.1.3 | **v7** | [v7.0.0](https://github.com/actions/download-artifact/releases/tag/v7.0.0) |
| `actions/cache` | v4 | **v5** | [v5.0.0](https://github.com/actions/cache/releases/tag/v5.0.0) |
| `actions/stale` | v9 | **v10** | [v10.0.0](https://github.com/actions/stale/releases/tag/v10.0.0) |

## Why

GitHub is [deprecating Node.js 20](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/) on Actions runners. The new versions of these actions now run on Node.js 24 by default (`runs.using: node24`).

## Requirements

- Minimum Actions Runner version: **v2.327.1**
- Self-hosted runners should be updated before merging

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

Test Plan:
- PR-triggered workflows (`test-all.yml`, `danger-pr.yml`) will validate core CI
- Other workflows will be validated when their respective triggers occur (schedules, releases, issue events)

Reviewed By: christophpurrer

Differential Revision: D89178299

Pulled By: cipolleschi

fbshipit-source-id: 889ca485486710bb3cd12122bef2731113b66077
2025-12-15 04:20:35 -08:00
Jakub Piasecki
e2165619dd Remove steps related to building hermes (#53901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53901

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D83051151

fbshipit-source-id: a88efd5ff908568a7b85ce6a6812103ee963766e
2025-10-22 09:48:13 -07:00
Jakub Piasecki
7f051c5470 Change leftover references to hermes.framework (#53390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53390

Changelog: [General][Fixed] - Change leftover references to `hermes.framework` to `hermesvm.framework`

Reviewed By: cipolleschi

Differential Revision: D80701257

fbshipit-source-id: 9c0e8e49e50f515941e48de2219fb7730d8896bd
2025-08-21 06:24:32 -07:00
Nicola Corti
a7a51275b5 Do not setup-node twice in test_js (#52737)
Summary:
I've noticed that test_js (20) and test_js (24) are actually running on Node 22.
That's because the `yarn-install` action is invoking setup-node again with the default value (22).

This changes it. Also I'm cleaning up the workflows so that every `yarn-install` invocation is happening just after the `setup-node` invocation.

## Changelog:

[INTERNAL] -

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

Test Plan: CI which will most likely be red for test_js (20) so will need a follow-up

Reviewed By: cipolleschi

Differential Revision: D78664671

Pulled By: cortinico

fbshipit-source-id: c73390930d1511d1bf0f2d4ea92e83f50b10247f
2025-07-21 08:51:05 -07:00
Alex Hunt
d4bf1b7af0 Remove experimental notice from V2 API snapshot and build by default (#52301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52301

Readying for imminent productionisation.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77386064

fbshipit-source-id: 2769545eace4e6c09da0b2f0f34cf74b2fdcb730
2025-06-27 04:49:28 -07:00
Riccardo Cipolleschi
be1db20c1e Publish ReactCore prebuilds to Maven central (#51923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51923

This diff publishes the Reactcore prebuilds to Maven central so that apps can use it when integrating with React Native

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76338793

fbshipit-source-id: 777c91805573b90ef15209e196cd66801908a5ce
2025-06-11 04:48:54 -07:00
Alex Hunt
1f27e3e2e4 Add build-types to release workflows (#50396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50396

Integrates the `yarn build-types` script into our CI workflows.

**Notes**

- Will validate type generation in future PRs as part of the `test-all` workflow (this has been stable (i.e. successfully runs for our codebase) for the last 3 weeks).
- This is not load bearing in production code until D71969602.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71975705

fbshipit-source-id: a234a05008b5e75976bbd5258948c37fcc1eeb76
2025-04-15 07:12:27 -07:00
Riccardo Cipolleschi
7ccb1e1fb0 Avoid the creation of separate folders for separate artifacts (#49760)
Summary:
When downloading artifacts using a pattern, GHA, by default, creates a folder for each artifacts and copies the artifacts in that folder.
This breaks the maven publishing which expects the artifacts in the `artifact` folder and not i a subfolder.

The `merge-multiple` option allow for the artifacts to be downloaded in the specified folder, without the extra folder in the path

## Changelog:
[Internal] - Avoid the creation of intermediate folder when downloading the artifacts

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

Test Plan:
GHA

<img width="791" alt="Screenshot 2025-03-02 at 11 08 33" src="https://github.com/user-attachments/assets/cfc85b27-117f-4d21-97ef-67493615a5a1" />

Reviewed By: fabriziocucci

Differential Revision: D70462254

Pulled By: cipolleschi

fbshipit-source-id: ed310a90bcdea55e466d4d71942a25abc6e6986a
2025-03-03 02:10:15 -08:00
Riccardo Cipolleschi
33c0112b63 Configure gradle to publish RNDependencies to Maven (#49749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49749

This change configures gradle and CI to properly publish the RNDependencies artifacts to Maven Central

## Changelog
[Internal] - Configure gradle to publish on Maven Central

Reviewed By: cortinico

Differential Revision: D70390191

fbshipit-source-id: fc1e1070325240584cb07fb17e58118c4c583fa9
2025-02-28 09:05:37 -08:00
Nicola Corti
e49f2d5c50 Enable Gradle Configuration Caching on CI (#49514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49514

This attemps to enable Config Caching on CI. I'm curious to see how much time this is going to save.
There might be some problems with nigthlies so I want to make sure this is running for some days before the branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D69846848

fbshipit-source-id: 0d5c292e65a6107df62f6494a1aae9abd0e8b6cc
2025-02-20 02:42:24 -08:00
Nick Gerleman
a28867f952 Remove home-rolled yarn caching (#48237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48237

Noticed this when trying to diagnose what seemed like a stale caching issue. It effectively reverts D59917944.

D59917944 added logic to only do yarn caching on main, but it has some correctness issues:
1. We cache `node_modules` instead of the yarn cache, which may contain e.g. build artifacts, or other scratch/cache files written (such as anything that writes to `node_modules/.cache`). We really want to be caching the yarn cache, which has pristine packages before install, which I think it will also need to perform the real install anyways.
2. We key the cache on root `package.json`, which is missing a lot of information (both provided by the other `package.json` in the repo, but mostly, the lockfile resolution).

We only save cache when we're on `refs/heads/main` (so continuous builds against main), and supposedly, builds against base branch should be able to restore against those, but recent PR jobs I have seen, where `package.json` has not changed, all have `Cache not found for input keys: node-modules-068350889e87919c1c6c2c220c8d2d92db13f38820bf2efb315d1274b97bc367`

Because of the potential correctness issues, and that the strategy for limiting to main seemingly is not allowing cache to be used in PR, this diff goes back to previous solution, which may store more artifacts (but working cache should also reduce cost by making jobs run faster).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67140004

fbshipit-source-id: f74074a498af56b1837fa23cf80795f76935b762
2024-12-12 09:13:52 -08:00
Nicola Corti
2ca01b4d04 Revert "Remove unnecessary git config --global --add safe.directory" (#45929)
Summary:
This reverts commit 9d9a8d2df6.

## Changelog:

[INTERNAL] - This reverts commit 9d9a8d2df6.

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60901502

Pulled By: cortinico

fbshipit-source-id: 2b7a7908a29f031c1f229907aa899a8a6960da4b
2024-08-07 06:39:31 -07:00
Riccardo Cipolleschi
24e7f7d256 Try to restore caches for Hermes (#45908)
Summary:
We had CI on main failing consistently the past couple of days.
The problem is that the hermes pipeline is failing to create the iOS XCFramework with the error:
> unable to create a Mach-O from the binary at '/Users/runner/work/react-native/react-native/packages/react-native/sdks/hermes/destroot/Library/Frameworks/catalyst/hermes.framework/hermes'

The main cause is this upgrade of [upload-artifacts](https://github.com/actions/upload-artifact/issues/590) which breaks symlinks.

The solution is to bump the caches and downgrade the `upload-artifact` actions.
## Changelog:
[Internal] - Try to fix CI for Hermes

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

Test Plan: GHA must be green

Reviewed By: cortinico

Differential Revision: D60828616

Pulled By: cipolleschi

fbshipit-source-id: 6976b86dd67e2fd9d806ebaa62f47e39dc44b30d
2024-08-06 06:41:35 -07:00
Nicola Corti
9d9a8d2df6 Remove unnecessary git config --global --add safe.directory (#45663)
Summary:
`git config --global --add safe.directory` is no longer necessary because is done inside the Docker container.

## Changelog:

[INTERNAL] - Remove unnecessary git config --global --add safe.directory

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60229662

Pulled By: cortinico

fbshipit-source-id: aa817ff27adaab3e3105ab22af74a871b377295b
2024-07-25 04:13:16 -07:00
Blake Friedman
4410899ec7 Only cache node_modules on main (#45544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45544

## This diff now does 5 things:
1. removes the old way we used `actions/setup-node` to manage the cache itself.
2. it creates a new `update-node-modules-cache` workflow, which is the only job that will update the node modules cache
3. it create a `yarn-install-with-cache` action that should be used install of directly calling `yarn install --non-interactive`.  This will load a cache against a hash of `package.json`.
4. updated the cache reaper to aggressively remove everything but the latest `npm-{{ hash('package.json') }}`.
5. removed a `cache-setup`, which couldn't be used (we're using artefacts now).

## Why are we doing this:
The various `node-cache-` keys for platforms and on various branches accounts for a very large proportion of the cache (10-20%).

We don't frequently change these dependencies, and even when we do running `yarn install` after loading the cache will resolve any issues.

Limiting the cache to `main` and aggressively pruning older cache entries will clean up a lot of "small win" caching.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59917944

fbshipit-source-id: 4be6f1959e8fde642a4f208f7d19aceba2c3262f
2024-07-19 13:04:07 -07:00
Riccardo Cipolleschi
32943263d0 Factor out build npm package (#45493)
Summary:
Factor out the Build NPM package job in a separate action for code reuse

## Changelog:
[Internal] - Factor out the Build NPM package job in a separate action for code reuse

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

Test Plan: GHA are green

Reviewed By: robhogan

Differential Revision: D59858572

Pulled By: cipolleschi

fbshipit-source-id: 561a215ba5812352034157aa254999db56fcd31e
2024-07-18 07:05:24 -07:00