mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
166
Commits
@@ -0,0 +1,172 @@
|
||||
# Circle CI
|
||||
|
||||
This directory is home to the Circle CI configuration files. Circle is our continuous integration service provider. You can see the overall status of React Native's builds at https://circleci.com/gh/facebook/react-native
|
||||
|
||||
You may also see an individual PR's build status by scrolling down to the Checks section in the PR.
|
||||
|
||||
## Purposes
|
||||
|
||||
We use CircleCI for mainly 3 purposes:
|
||||
|
||||
1. Testing changes
|
||||
2. Release Nightlies
|
||||
3. Release Stable Versions of React Native
|
||||
|
||||
When testing changes, we run all the tests on commits that lands on `main`. For commits in PR, we try to understand which kind of changes the PR is about and we try to selectively run only the relevant tests. so, for example, if a PR only touches iOS files, we are going to run only iOS tests.
|
||||
|
||||
A Nighly job runs every day at around 9:00 PM, GMT. They run from `main` and they publish a version of React Native using the current state of the codebase, creating a version number that follows the format: `0.<current-version+1>.0-nightly-<YYYYMMDD>-<short-commit-hash>`.
|
||||
The nightly job also publish all the monorepo packages, taking care of updating the transitive dependencies of those packages.
|
||||
|
||||
Stable versions are released manually by the Release Crew and they run from a stable branch. Stable branches have the shape of `0.<version>-stable`.
|
||||
|
||||
## How It Works?
|
||||
|
||||
CircleCI execution is now split in two steps:
|
||||
- Setup
|
||||
- Testing
|
||||
|
||||
The setup step takes care of analyzing the changes in the PR and of deciding which jobs needs to run.
|
||||
|
||||
The testing flow is a set of workflows that executes the required tests.
|
||||
|
||||
### Setup
|
||||
|
||||
The code of the setup workflow lives in the root [`config.yml`](https://github.com/facebook/react-native/blob/main/.circleci/config.yml) file.
|
||||
It uses the `Continuation orb` from CircleCI to start a CI flow that depends on the changes present in the PR.
|
||||
|
||||
If the changes are not coming from a PR (either a simple commit or if the CI is running on main) **we always run all the tests** as a cautionary measure.
|
||||
|
||||
The setup job has also to expose all the pipeline parameters that we would need to pass to the actual workflow. Those parameters are **automatically forwarded** to the workflows that are started as a result of the setup.
|
||||
|
||||
The setup job uses a JS script to carry on its logic. The [`pipeline_selection.js`](https://github.com/facebook/react-native/blob/main/scripts/circleci/pipeline_selection.js) script can be invoked with two commands:
|
||||
- `filter-jobs`
|
||||
- `create-configs`
|
||||
|
||||
The **`filter-jobs`** command takes care of creating a JSON representation of the tests we need to run based on the changes in the PR.
|
||||
|
||||
The **`create-configs`** command consumes the JSON representation to create a CircleCI configuration that can then executes all the required tests.
|
||||
|
||||
#### Creating a Configuration
|
||||
|
||||
To create a configuration, the `pipeline-selection` scripts collates together various pieces of `YML` files that lives in the [`Configurations` folder](https://github.com/facebook/react-native/tree/main/.circleci/configurations).
|
||||
|
||||
The order in which these files are appended is **important** and it always contains the following.:
|
||||
|
||||
1. `top_level.yml`: this file contains some high level directives for CircleCI, like the version, the list of orbs, the cache-keys, and the pipeline parameters that can be used by the workflows.
|
||||
2. `executors.yml`: this file contains the list of the executors used in our jobs and their configurations.
|
||||
3. `commands.yml`: this file contains all the commands that can be used by jobs to executes. Commands are reusable functions that are shared by multiple jobs.
|
||||
4. `jobs.yml`: this file contains the jobs that are used by workflows to carry on some specific tasks. They are composed of sequential commands.
|
||||
5. `workflows.yml`: this file contains the shared workflows that needs to (or can) be always executed, no matter which kind of changes are pushed to CI. An example of these workflows is `analysis` (which is always executed) or `nightly` (which can be executed if a specific pipeline parameter is passed to the CI).
|
||||
|
||||
Then, the `pipeline_selection create-configs` attach some specific test workflows, depending on the changes that are present in the PR. These change-dependent workflows live in the [`test_workflows`](https://github.com/facebook/react-native/tree/main/.circleci/configurations/test_workflows) folder.
|
||||
These workflows are:
|
||||
* `testAll.yml` => runs all the possible tests. This workflow is executed on main and on PRs which change set touches both iOS and Android
|
||||
* `testAndroid.yml` => runs all the build steps and Android tests. This is used on changes that happens on the Android codebase and infra (`ReactAndroid` folder)
|
||||
* `testIOS.yml` => runs all the build steps and iOS tests. This is used on changes that happens on the iOS codebase and infra (`React` folder)
|
||||
* `testE2E.yml` => runs the E2E tests. As of today, E2E tests can be triggered if the commit message contains the `#run-e2e-tests` tag.
|
||||
* `testJS.yml` => For all the changes that do not touch native/platform code, we only run JS tests.
|
||||
|
||||
Notice that if there are changes on files that do not represents code (for example `.md` files like this one or the `Changelog`) we don't run any CI.
|
||||
|
||||
## Test workflows
|
||||
|
||||
The test workflows for native code are composed of 2 parts:
|
||||
- building React Native
|
||||
- testing
|
||||
|
||||
Building React Native requires us to build several parts of it:
|
||||
1. We need to build the Hermes JS engine
|
||||
2. We need to build Android to create prebuilds
|
||||
3. We need to package everything in an npm package that will mimic a React native release
|
||||
4. We need to create a local maven repository
|
||||
|
||||
### Building Hermes Engine
|
||||
|
||||
#### Android
|
||||
The `build_android` workflows takes care of building the Android version of Hermes and to put it properly in a local maven repository.
|
||||
See the [Build Android](#build_android) section below.
|
||||
|
||||
#### iOS
|
||||
Hermes is a very complicated item to build for iOS.
|
||||
It is composed of the Hermes compiler (HermesC) and of the actual engine.
|
||||
|
||||
Hermes is shipped as a universal XCFramework. This means that we need to build all the architecture slices and then put them together in the XCFramework archive.
|
||||
We also need to build 2 configurations: Debug and Release.
|
||||
|
||||
In order to be efficient and to save costs, we parallelize the process as much as possible:
|
||||
|
||||
1. We prepare the environment for building Hermes.
|
||||
2. We build HermesC which is required by all the slices.
|
||||
3. We start 8 jobs to build all the required slices in parallel:
|
||||
1. `iphone` slice, Debug mode
|
||||
1. `iphonesimulator` slice, Debug mode
|
||||
1. `macos` slice, Debug mode
|
||||
1. `catalyst` slice, Debug mode
|
||||
1. `iphone` slice, Release mode
|
||||
1. `iphonesimulator` slice, Release mode
|
||||
1. `macos` slice, Release mode
|
||||
1. `catalyst` slice, Release mode
|
||||
4. We then have 2 jobs to create the Debug and Release tarballs in parallel.
|
||||
1. The Debug job receives the 4 Debug slices
|
||||
1. The Release job receives the 4 Release slices
|
||||
|
||||
The `Debug` and `Release` tarball are then uploaded as artifacts. Notice that these we use these artifacts to **test the release** of React Native.
|
||||
|
||||
While building Hermes, we take also care of building the dSYMs. A dSYM (Debug Symbols) is an archive that contains the Debug Symbols that users can load to de-symbolicate the Hermes Stack traces. These symbols are published when we create a React Native release.
|
||||
|
||||
A lot of these build steps are automated by some shell scripts that lives in the [`react-native/packages/react-native/sdks/hermes-engine/utils` folder](https://github.com/facebook/react-native/tree/main/packages/react-native/sdks/hermes-engine/utils).
|
||||
|
||||
### Build Android
|
||||
|
||||
The android build is all managed by Gradle, so building android should be as easy as calling a [`gradle` command](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L268-L274).
|
||||
|
||||
The relevant part here is that the build android generates a `maven-local` repository that is passed to the [`build_npm_package`](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L1182) and that we use to test the releases.
|
||||
|
||||
### Build NPM package
|
||||
|
||||
This job is the responsible to create an NPM package that is suitable to be released or tested in CI.
|
||||
If we are in a release flow (for example the Nightly workflow), it also proceed with the publication.
|
||||
|
||||
The job can be invoked with different parameters:
|
||||
- `dry-run` => it does not publish anything, but prepare the artifacts to be used for testing
|
||||
- `nightly` => it creates the artifacts and publish a nightly version of React Native.
|
||||
- `release` => it creates the artifacts and publish a stable version of React Native.
|
||||
|
||||
The build NPM package takes all the artifacts produced in the previous steps (iOS' Hermes, iOS' Hermes dSYMs, Android's `maven-local`) and creates an npm package packing all the code.
|
||||
|
||||
If in a release mode, it also proceed publishing the NPM package to NPM, and the artifacts to Maven central, which we use to distribute all the artifacts.
|
||||
|
||||
This job also uploads the `maven-local` repository and a zipped version of the npm package to CircleCI's artifacts. We use these artifacts to **test the release** of React Native.
|
||||
|
||||
## Testing React Native
|
||||
React Native tests runs in two different scenarios:
|
||||
- RNTester
|
||||
- A New App
|
||||
|
||||
### RNTester
|
||||
RNTester is our internal testing app. It is a fully working React Native app that lives in the [`react-native/packages/rn-tester` folder](https://github.com/facebook/react-native/tree/main/packages/rn-tester) of the repository.
|
||||
RNTester is an app which contains code that exercise most part of the React Native frameworks.
|
||||
It also has the feature of building React Native **from source**. For that reason, it does not have to wait for the NPM package to be ready, but RNTester's tests can start as soon as the `build_android` step and the step that builds Hermes for iOS are done.
|
||||
|
||||
Notice the Tests on RNTester for iOS consumes the Hermes engine that is built in the previous steps.
|
||||
|
||||
For Android, these tests creates an APK that is uploaded as an artifact in CircleCI. We use these artifacts to **test the releases** of React Native..
|
||||
|
||||
### A New App
|
||||
The React Native repo contains a template app in the [`react-native/packages/react-native/template` folder]() that is used to spin up a new application that is preconfigured with React Native.
|
||||
|
||||
We have several tests that we run starting from the template, testing various configurations:
|
||||
- Debug/Release
|
||||
- JSC/Hermes (two different JS engine we support)
|
||||
- New/Old Architecture (two different Architectures for React Native)
|
||||
|
||||
We want to test all the React Native changes against the template, but we can't publish a React native version on each change that is merged. Therefore, to run tests on the template we use a NPM registry proxy called [Verdaccio](https://verdaccio.org/).
|
||||
|
||||
When running a Template test our CI follows roughly these steps:
|
||||
1. Prepare the executor
|
||||
2. Start a Verdaccio server
|
||||
3. Publish on Verdaccio all the monorepo [packages](https://github.com/facebook/react-native/tree/main/packages) on which React Native depends on.
|
||||
4. Publish on Verdaccio the react-native NPM package that has been created in the NPM step
|
||||
5. Spin up a new React native apps from the template, downloading react-native from Verdaccio.
|
||||
|
||||
In this way, we are sure that we can test all the changes that happen in React Native on a new React Native app.
|
||||
@@ -0,0 +1,114 @@
|
||||
version: 2.1
|
||||
|
||||
# this allows you to use CircleCI's dynamic configuration feature
|
||||
setup: true
|
||||
|
||||
orbs:
|
||||
continuation: circleci/continuation@1.0.0
|
||||
|
||||
parameters:
|
||||
# Real pipelines parameters
|
||||
run_release_workflow:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
run_nightly_workflow:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
release_version:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
release_monorepo_packages_version:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
release_tag:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
release_dry_run:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
choose_ci_jobs:
|
||||
docker:
|
||||
- image: debian:bullseye
|
||||
resource_class: small
|
||||
steps:
|
||||
- run:
|
||||
name: Install Yarn
|
||||
command: |
|
||||
apt update
|
||||
apt install -y wget git curl jq
|
||||
|
||||
apt-get update
|
||||
apt-get install -y ca-certificates curl gnupg
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
|
||||
NODE_MAJOR=18
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
apt-get update
|
||||
|
||||
apt install -y nodejs
|
||||
npm install --global yarn
|
||||
- checkout
|
||||
- run:
|
||||
name: Yarn Install
|
||||
command: yarn install
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ main, << pipeline.git.branch >> ]
|
||||
- matches:
|
||||
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
|
||||
value: << pipeline.git.branch >>
|
||||
steps:
|
||||
- run:
|
||||
name: "[Main or Stable] Create input for config to test everything"
|
||||
command: |
|
||||
mkdir -p /tmp/circleci/
|
||||
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
|
||||
- when:
|
||||
condition:
|
||||
not:
|
||||
or:
|
||||
- equal: [ main, << pipeline.git.branch >> ]
|
||||
- matches:
|
||||
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
|
||||
value: << pipeline.git.branch >>
|
||||
steps:
|
||||
- run:
|
||||
name: "[PR Branch] Filter jobs"
|
||||
command: |
|
||||
if [[ -z "$CIRCLE_PULL_REQUEST" ]]; then
|
||||
echo "Not in a PR. Can't filter properly outside a PR. Please open a PR so that we can run the proper CI tests."
|
||||
echo "For safety, we run all the tests!"
|
||||
mkdir -p /tmp/circleci/
|
||||
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
|
||||
else
|
||||
PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}"
|
||||
node ./scripts/circleci/pipeline_selection.js filter-jobs
|
||||
fi
|
||||
- run:
|
||||
name: Create config
|
||||
description: Generates a configuration on the fly, depending on the files that have been modified
|
||||
command: |
|
||||
node ./scripts/circleci/pipeline_selection.js create-configs
|
||||
- store_artifacts:
|
||||
path: .circleci/generated_config.yml
|
||||
destination: generated_config.yml
|
||||
- continuation/continue:
|
||||
configuration_path: .circleci/generated_config.yml
|
||||
|
||||
# our single workflow, that triggers the setup job defined above
|
||||
workflows:
|
||||
always-run:
|
||||
jobs:
|
||||
- choose_ci_jobs:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
@@ -0,0 +1,580 @@
|
||||
# -------------------------
|
||||
# COMMANDS
|
||||
# -------------------------
|
||||
commands:
|
||||
# Checkout with cache, on machines that are using Docker the cache is ignored
|
||||
checkout_code_with_cache:
|
||||
parameters:
|
||||
checkout_base_cache_key:
|
||||
default: *checkout_cache_key
|
||||
type: string
|
||||
steps:
|
||||
- restore_cache:
|
||||
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
|
||||
- checkout
|
||||
- save_cache:
|
||||
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- ".git"
|
||||
|
||||
setup_ruby:
|
||||
parameters:
|
||||
ruby_version:
|
||||
default: "2.6.10"
|
||||
type: string
|
||||
steps:
|
||||
- restore_cache:
|
||||
key: *gems_cache_key
|
||||
- run:
|
||||
name: Set Required Ruby
|
||||
command: echo << parameters.ruby_version >> > /tmp/required_ruby
|
||||
- restore_cache:
|
||||
key: *rbenv_cache_key
|
||||
- run:
|
||||
name: Install the proper Ruby and run Bundle install
|
||||
command: |
|
||||
# Check if rbenv is installed. CircleCI is migrating to rbenv so we may not need to always install it.
|
||||
|
||||
if [[ -z "$(command -v rbenv)" ]]; then
|
||||
brew install rbenv ruby-build
|
||||
# Load and init rbenv
|
||||
(rbenv init 2> /dev/null) || true
|
||||
echo '' >> ~/.bash_profile
|
||||
echo 'eval "$(rbenv init - bash)"' >> ~/.bash_profile
|
||||
source ~/.bash_profile
|
||||
else
|
||||
echo "rbenv found; Skipping installation"
|
||||
fi
|
||||
|
||||
# Install the right version of ruby
|
||||
if [[ -z "$(rbenv versions | grep << parameters.ruby_version >>)" ]]; then
|
||||
# ensure that `ruby-build` can see all the available versions of Ruby
|
||||
# some PRs received machines in a weird state, this should make the pipelines
|
||||
# more robust.
|
||||
brew update && brew upgrade ruby-build
|
||||
rbenv install << parameters.ruby_version >>
|
||||
fi
|
||||
|
||||
# Set ruby dependencies
|
||||
rbenv global << parameters.ruby_version >>
|
||||
if [[ << parameters.ruby_version >> == "2.6.10" ]]; then
|
||||
# RubyGems 3.0.3.1 breaks Bundler
|
||||
gem update --system 3.2.3
|
||||
rbenv rehash
|
||||
gem install bundler -v 2.4.22
|
||||
else
|
||||
rbenv rehash
|
||||
gem install bundler
|
||||
fi
|
||||
bundle check || bundle install --path vendor/bundle --clean
|
||||
- save_cache:
|
||||
key: *rbenv_cache_key
|
||||
paths:
|
||||
- ~/.rbenv
|
||||
- save_cache:
|
||||
key: *gems_cache_key
|
||||
paths:
|
||||
- vendor/bundle
|
||||
|
||||
run_yarn:
|
||||
parameters:
|
||||
yarn_base_cache_key:
|
||||
default: *yarn_cache_key
|
||||
type: string
|
||||
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
|
||||
- << parameters.yarn_base_cache_key >>-{{ arch }}
|
||||
- << parameters.yarn_base_cache_key >>
|
||||
- run:
|
||||
name: "Yarn: Install Dependencies"
|
||||
command: |
|
||||
# Skip yarn install on metro bump commits as the package is not yet
|
||||
# available on npm
|
||||
if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
|
||||
yarn install --non-interactive --cache-folder ~/.cache/yarn
|
||||
fi
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
key: << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
|
||||
|
||||
build_packages:
|
||||
steps:
|
||||
- run:
|
||||
name: Build packages
|
||||
command: yarn build
|
||||
|
||||
brew_install:
|
||||
parameters:
|
||||
package:
|
||||
description: Homebrew package to install
|
||||
type: string
|
||||
steps:
|
||||
- run:
|
||||
name: "Brew: Install << parameters.package >>"
|
||||
command: brew install << parameters.package >>
|
||||
|
||||
with_rntester_pods_cache_span:
|
||||
parameters:
|
||||
steps:
|
||||
type: steps
|
||||
steps:
|
||||
- run:
|
||||
name: Setup CocoaPods cache
|
||||
# Copy packages/rn-tester/Podfile.lock since it can be changed by pod install
|
||||
command: cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak
|
||||
- restore_cache:
|
||||
keys:
|
||||
# The committed lockfile is generated using static libraries and USE_HERMES=1 so it could load an outdated cache if a change
|
||||
# only affects the frameworks or hermes config. To help prevent this also cache based on the content of Podfile.
|
||||
- *pods_cache_key
|
||||
- steps: << parameters.steps >>
|
||||
- save_cache:
|
||||
paths:
|
||||
- packages/rn-tester/Pods
|
||||
key: *pods_cache_key
|
||||
|
||||
with_gradle_cache:
|
||||
parameters:
|
||||
steps:
|
||||
type: steps
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- *gradle_cache_key
|
||||
- v3-gradle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-
|
||||
- v3-gradle-{{ .Environment.CIRCLE_JOB }}-
|
||||
- v3-gradle-
|
||||
- steps: << parameters.steps >>
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.gradle/caches
|
||||
- ~/.gradle/wrapper
|
||||
- packages/react-native/ReactAndroid/build/downloads
|
||||
- packages/react-native/ReactAndroid/build/third-party-ndk
|
||||
key: *gradle_cache_key
|
||||
|
||||
run_e2e:
|
||||
parameters:
|
||||
platform:
|
||||
description: Target platform
|
||||
type: enum
|
||||
enum: ["android", "ios", "js"]
|
||||
default: "js"
|
||||
retries:
|
||||
description: How many times the job should try to run these tests
|
||||
type: integer
|
||||
default: 3
|
||||
steps:
|
||||
- run:
|
||||
name: "Run Tests: << parameters.platform >> End-to-End Tests"
|
||||
command: node ./scripts/e2e/run-ci-e2e-tests.js --<< parameters.platform >> --retries << parameters.retries >>
|
||||
|
||||
report_bundle_size:
|
||||
parameters:
|
||||
platform:
|
||||
description: Target platform
|
||||
type: enum
|
||||
enum: ["android", "ios"]
|
||||
steps:
|
||||
- run:
|
||||
name: Report size of RNTester.app (analysis-bot)
|
||||
command: GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" scripts/circleci/report-bundle-size.sh << parameters.platform >> || true
|
||||
|
||||
setup_hermes_version:
|
||||
steps:
|
||||
- run:
|
||||
name: Set up Hermes workspace and caching
|
||||
command: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "$HERMES_VERSION_FILE" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
cat $HERMES_VERSION_FILE > /tmp/hermes/hermesversion
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
|
||||
echo $HERMES_TAG_SHA > /tmp/hermes/hermesversion
|
||||
fi
|
||||
cat /tmp/hermes/hermesversion
|
||||
|
||||
get_react_native_version:
|
||||
steps:
|
||||
- run:
|
||||
name: Get React Native version
|
||||
command: |
|
||||
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
|
||||
# Save the react native version we are building in a file so we can use that file as part of the cache key.
|
||||
echo "$VERSION" > /tmp/react-native-version
|
||||
echo "React Native Version is $(cat /tmp/react-native-version)"
|
||||
HERMES_VERSION="$(cat /tmp/hermes/hermesversion)"
|
||||
echo "Hermes commit is $HERMES_VERSION"
|
||||
|
||||
get_react_native_version_windows:
|
||||
steps:
|
||||
- run:
|
||||
name: Get React Native version on Windows
|
||||
command: |
|
||||
$VERSION=cat packages/react-native/package.json | jq -r '.version'
|
||||
# Save the react native version we are building in a file so we can use that file as part of the cache key.
|
||||
echo "$VERSION" > /tmp/react-native-version
|
||||
echo "React Native Version is $(cat /tmp/react-native-version)"
|
||||
$HERMES_VERSION=cat C:\Users\circleci\project\tmp\hermes\hermesversion
|
||||
echo "Hermes commit is $HERMES_VERSION"
|
||||
|
||||
with_hermes_tarball_cache_span:
|
||||
parameters:
|
||||
steps:
|
||||
type: steps
|
||||
set_tarball_path:
|
||||
type: boolean
|
||||
default: False
|
||||
flavor:
|
||||
default: "Debug"
|
||||
description: The Hermes build type. Must be one of "Debug", "Release".
|
||||
type: enum
|
||||
enum: ["Debug", "Release"]
|
||||
hermes_tarball_artifacts_dir:
|
||||
type: string
|
||||
default: *hermes_tarball_artifacts_dir
|
||||
steps:
|
||||
- get_react_native_version
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Debug"]
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- *hermes_tarball_debug_cache_key
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Release"]
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- *hermes_tarball_release_cache_key
|
||||
- when:
|
||||
condition: << parameters.set_tarball_path >>
|
||||
steps:
|
||||
- run:
|
||||
name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
|
||||
command: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d ~/react-native ]; then
|
||||
echo "No React Native checkout found. Run `checkout` first."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ~/react-native/packages/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "export HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $BASH_ENV
|
||||
- run:
|
||||
name: Print Hermes version
|
||||
command: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
|
||||
TARBALL_FILENAME=$(node ~/react-native/packages/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
if [[ -e $TARBALL_PATH ]]; then
|
||||
tar -xf $TARBALL_PATH
|
||||
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
|
||||
./destroot/bin/hermes test.js
|
||||
rm test.js
|
||||
rm -rf destroot
|
||||
else
|
||||
echo 'No Hermes tarball found.'
|
||||
fi
|
||||
- steps: << parameters.steps >>
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Debug"]
|
||||
steps:
|
||||
- save_cache:
|
||||
key: *hermes_tarball_debug_cache_key
|
||||
paths: *hermes_tarball_cache_paths
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Release"]
|
||||
steps:
|
||||
- save_cache:
|
||||
key: *hermes_tarball_release_cache_key
|
||||
paths: *hermes_tarball_cache_paths
|
||||
|
||||
store_hermes_apple_artifacts:
|
||||
description: Stores the tarball and the osx binaries
|
||||
parameters:
|
||||
flavor:
|
||||
default: "Debug"
|
||||
description: The Hermes build type. Must be one of "Debug", "Release".
|
||||
type: enum
|
||||
enum: ["Debug", "Release"]
|
||||
steps:
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Debug"]
|
||||
steps:
|
||||
- store_artifacts:
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-debug.tar.gz
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Release"]
|
||||
steps:
|
||||
- store_artifacts:
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-release.tar.gz
|
||||
- store_artifacts:
|
||||
path: /tmp/hermes/osx-bin/<< parameters.flavor >>/hermesc
|
||||
- store_artifacts:
|
||||
path: /tmp/hermes/dSYM/<< parameters.flavor >>/hermes.framework.dSYM
|
||||
|
||||
stop_job_if_apple_artifacts_are_there:
|
||||
description: Stops the current job if there are already the required artifacts
|
||||
parameters:
|
||||
flavor:
|
||||
default: "All"
|
||||
description: The flavor of artifacts to check. Must be one of "Debug", "Release" or "All"
|
||||
type: enum
|
||||
enum: ["Debug", "Release", "All"]
|
||||
steps:
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "All"]
|
||||
steps:
|
||||
- run:
|
||||
name: "Export files to be checked"
|
||||
command: |
|
||||
echo "/tmp/hermes/Release_tarball_present" > /tmp/hermes_files
|
||||
echo "/tmp/hermes/Debug_tarball_present" >> /tmp/hermes_files
|
||||
echo "/tmp/hermes/Release_osx_bin" >> /tmp/hermes_files
|
||||
echo "/tmp/hermes/Debug_osx_bin" >> /tmp/hermes_files
|
||||
echo "/tmp/hermes/Release_dSYM" >> /tmp/hermes_files
|
||||
echo "/tmp/hermes/Debug_dSYM" >> /tmp/hermes_files
|
||||
- when:
|
||||
condition:
|
||||
not:
|
||||
equal: [ << parameters.flavor >>, "All"]
|
||||
steps:
|
||||
- run:
|
||||
name: "Export files to be checked"
|
||||
command: |
|
||||
echo "/tmp/hermes/<< parameters.flavor >>_tarball_present" > /tmp/hermes_files
|
||||
echo "/tmp/hermes/<< parameters.flavor >>_osx_bin" >> /tmp/hermes_files
|
||||
echo "/tmp/hermes/<< parameters.flavor >>_dSYM" >> /tmp/hermes_files
|
||||
- run:
|
||||
name: Stop if files are present
|
||||
command: |
|
||||
files=($(cat /tmp/hermes_files))
|
||||
# Initialize a flag indicating all files exist
|
||||
|
||||
all_files_exist=true
|
||||
|
||||
for file in "${files[@]}"; do
|
||||
if [[ ! -f "$file" ]]; then
|
||||
all_files_exist=false
|
||||
echo "$file does not exist."
|
||||
else
|
||||
echo "$file exist."
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$all_files_exist" == true ]]; then
|
||||
echo "Tarball, osx-bin and dSYM are present. Halting this job"
|
||||
circleci-agent step halt
|
||||
fi
|
||||
|
||||
check_if_tarball_is_present:
|
||||
description: "Checks if the tarball of a specific Flavor is present and adds a marker file"
|
||||
parameters:
|
||||
flavor:
|
||||
default: "Debug"
|
||||
description: The flavor of artifacts to check. Must be one of "Debug" or "Release"
|
||||
type: enum
|
||||
enum: ["Debug", "Release"]
|
||||
steps:
|
||||
- run:
|
||||
name: Check if << parameters.flavor >> tarball is there
|
||||
command: |
|
||||
FLAVOR=debug
|
||||
if [[ << parameters.flavor >> == "Release" ]]; then
|
||||
FLAVOR=release
|
||||
fi
|
||||
|
||||
if [[ -f "/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz" ]]; then
|
||||
echo "[HERMES TARBALL] Found the << parameters.flavor >> tarball"
|
||||
touch /tmp/hermes/<< parameters.flavor >>_tarball_present
|
||||
fi
|
||||
|
||||
check_if_osx_bin_is_present:
|
||||
description: "Checks if the osx bin of a specific Flavor is present and adds a marker file"
|
||||
parameters:
|
||||
flavor:
|
||||
default: "Debug"
|
||||
description: The flavor of artifacts to check. Must be one of "Debug" or "Release"
|
||||
type: enum
|
||||
enum: ["Debug", "Release"]
|
||||
steps:
|
||||
- run:
|
||||
name: Check if macosx binary is there
|
||||
command: |
|
||||
if [[ -d /tmp/hermes/osx-bin/<< parameters.flavor >> ]]; then
|
||||
echo "[HERMES MACOSX BIN] Found the osx bin << parameters.flavor >>"
|
||||
touch /tmp/hermes/<< parameters.flavor >>_osx_bin
|
||||
fi
|
||||
|
||||
check_if_dsym_are_present:
|
||||
description: "Checks if the dSYM a specific Flavor are present and adds a marker file"
|
||||
parameters:
|
||||
flavor:
|
||||
default: "Debug"
|
||||
description: The flavor of artifacts to check. Must be one of "Debug" or "Release"
|
||||
type: enum
|
||||
enum: ["Debug", "Release"]
|
||||
steps:
|
||||
- run:
|
||||
name: Check if dSYM are there
|
||||
command: |
|
||||
if [[ -d /tmp/hermes/dSYM/<< parameters.flavor >> ]]; then
|
||||
echo "[HERMES dSYM] Found the dSYM << parameters.flavor >>"
|
||||
touch /tmp/hermes/<< parameters.flavor >>_dSYM
|
||||
fi
|
||||
|
||||
setup_hermes_workspace:
|
||||
description: "Setup Hermes Workspace"
|
||||
steps:
|
||||
- run:
|
||||
name: Set up workspace
|
||||
command: |
|
||||
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./packages/react-native/sdks/hermes
|
||||
cp -r $HERMES_WS_DIR/hermes/* ./packages/react-native/sdks/hermes/.
|
||||
cp -r ./packages/react-native/sdks/hermes-engine/utils ./packages/react-native/sdks/hermes/.
|
||||
|
||||
with_xcodebuild_cache:
|
||||
description: "Add caching to iOS jobs to speed up builds"
|
||||
parameters:
|
||||
steps:
|
||||
type: steps
|
||||
podfile_lock_path:
|
||||
type: string
|
||||
default: packages/rn-tester/Podfile.lock
|
||||
pods_build_folder:
|
||||
type: string
|
||||
default: packages/rn-tester/Pods
|
||||
podfile_lock_cache_key:
|
||||
type: string
|
||||
default: *rntester_podfile_lock_cache_key
|
||||
cocoapods_cache_key:
|
||||
type: string
|
||||
default: *cocoapods_cache_key
|
||||
steps:
|
||||
- run:
|
||||
name: Prepare Xcodebuild cache
|
||||
command: |
|
||||
WEEK=$(date +"%U")
|
||||
YEAR=$(date +"%Y")
|
||||
echo "$WEEK-$YEAR" > /tmp/week_year
|
||||
- restore_cache:
|
||||
key: << parameters.podfile_lock_cache_key >>
|
||||
- restore_cache:
|
||||
key: << parameters.cocoapods_cache_key >>
|
||||
- steps: << parameters.steps >>
|
||||
- save_cache:
|
||||
key: << parameters.podfile_lock_cache_key >>
|
||||
paths:
|
||||
- << parameters.podfile_lock_path >>
|
||||
- save_cache:
|
||||
key: << parameters.cocoapods_cache_key >>
|
||||
paths:
|
||||
- << parameters.pods_build_folder >>
|
||||
|
||||
store_artifacts_if_needed:
|
||||
description: "This step stores the artifacts only if we are on main or on a stable branch"
|
||||
parameters:
|
||||
path:
|
||||
type: string
|
||||
destination:
|
||||
type: string
|
||||
default: << parameters.path >>
|
||||
when:
|
||||
type: enum
|
||||
enum: ['always', 'on_fail', 'on_success']
|
||||
default: 'always'
|
||||
steps:
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ main, << pipeline.git.branch >> ]
|
||||
- matches:
|
||||
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
|
||||
value: << pipeline.git.branch >>
|
||||
steps:
|
||||
- store_artifacts:
|
||||
when: << parameters.when >>
|
||||
path: << parameters.path >>
|
||||
destination: << parameters.destination >>
|
||||
|
||||
prepare_ios_tests:
|
||||
description: This command runs a set of commands to prepare iOS for running unit tests
|
||||
steps:
|
||||
- brew_install:
|
||||
package: xcbeautify
|
||||
- run:
|
||||
name: Run Ruby Tests
|
||||
command: |
|
||||
cd packages/react-native/scripts
|
||||
sh run_ruby_tests.sh
|
||||
- run:
|
||||
name: Boot iPhone Simulator
|
||||
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
|
||||
|
||||
- run:
|
||||
name: Configure Environment Variables
|
||||
command: |
|
||||
echo 'export PATH=/usr/local/opt/node@18/bin:$PATH' >> $BASH_ENV
|
||||
source $BASH_ENV
|
||||
|
||||
- run:
|
||||
name: "Brew: Tap wix/brew"
|
||||
command: brew tap wix/brew
|
||||
- brew_install:
|
||||
package: applesimutils watchman
|
||||
- run:
|
||||
name: Configure Watchman
|
||||
command: echo "{}" > .watchmanconfig
|
||||
|
||||
run_ios_tests:
|
||||
description: This command run iOS tests and collects results
|
||||
steps:
|
||||
- run:
|
||||
name: "Run Tests: iOS Unit and Integration Tests"
|
||||
command: yarn test-ios
|
||||
- run:
|
||||
name: Zip Derived data folder
|
||||
when: always
|
||||
command: |
|
||||
echo "zipping tests results"
|
||||
cd /Users/distiller/Library/Developer/Xcode
|
||||
XCRESULT_PATH=$(find . -name '*.xcresult')
|
||||
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
|
||||
- store_artifacts_if_needed:
|
||||
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
|
||||
- report_bundle_size:
|
||||
platform: ios
|
||||
- store_test_results:
|
||||
path: ./reports/junit
|
||||
@@ -0,0 +1,38 @@
|
||||
# -------------------------
|
||||
# EXECUTORS
|
||||
# -------------------------
|
||||
executors:
|
||||
nodelts:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: *nodelts_image
|
||||
resource_class: "large"
|
||||
nodeprevlts:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: *nodeprevlts_image
|
||||
resource_class: "large"
|
||||
# Executor with Node & Java used to inspect and lint
|
||||
node-browsers-small:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: *nodelts_browser_image
|
||||
resource_class: "small"
|
||||
node-browsers-medium:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: *nodelts_browser_image
|
||||
resource_class: "medium"
|
||||
reactnativeandroid-xlarge:
|
||||
<<: *android-defaults
|
||||
resource_class: "xlarge"
|
||||
reactnativeandroid-large:
|
||||
<<: *android-defaults
|
||||
resource_class: "large"
|
||||
reactnativeios:
|
||||
<<: *defaults
|
||||
macos:
|
||||
xcode: *xcode_version
|
||||
resource_class: macos.m1.medium.gen1
|
||||
environment:
|
||||
- RCT_BUILD_HERMES_FROM_SOURCE: true
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,99 @@
|
||||
tests:
|
||||
when:
|
||||
and:
|
||||
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
jobs:
|
||||
- prepare_release:
|
||||
name: "prepare_release (dry run test)"
|
||||
version: "0.0.0"
|
||||
monorepo_packages_version: "0.0.0"
|
||||
tag: test
|
||||
dry_run: true
|
||||
- prepare_hermes_workspace
|
||||
- build_android:
|
||||
release_type: "dry-run"
|
||||
- build_hermesc_linux:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_hermesc_apple:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_apple_slices_hermes:
|
||||
requires:
|
||||
- build_hermesc_apple
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
|
||||
- build_hermes_macos:
|
||||
requires:
|
||||
- build_apple_slices_hermes
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
- build_hermesc_windows:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_npm_package:
|
||||
# Build a release package on every untagged commit, but do not publish to npm.
|
||||
release_type: "dry-run"
|
||||
requires:
|
||||
- build_android
|
||||
- build_hermesc_linux
|
||||
- build_hermes_macos
|
||||
- build_hermesc_windows
|
||||
- test_android:
|
||||
requires:
|
||||
- build_android
|
||||
## Disabled to land removing react-native/template. Re-enable once switched over
|
||||
## to Helloworld.
|
||||
# - test_android_template:
|
||||
# requires:
|
||||
# - build_npm_package
|
||||
# matrix:
|
||||
# parameters:
|
||||
# architecture: ["NewArch", "OldArch"]
|
||||
# jsengine: ["Hermes", "JSC"]
|
||||
# flavor: ["Debug", "Release"]
|
||||
- test_ios_helloworld:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
name: "Test Template with Ruby 3.2.2"
|
||||
ruby_version: "3.2.2"
|
||||
architecture: "NewArch"
|
||||
flavor: "Debug"
|
||||
jsengine: "Hermes"
|
||||
use_frameworks: "StaticLibraries"
|
||||
- test_ios_helloworld:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
|
||||
exclude:
|
||||
# This config is tested with Ruby 3.2.2. Let's not double test it.
|
||||
- flavor: "Debug"
|
||||
jsengine: "Hermes"
|
||||
use_frameworks: "StaticLibraries"
|
||||
- test_ios_rntester:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
use_frameworks: "DynamicFrameworks"
|
||||
architecture: "NewArch"
|
||||
ruby_version: "3.2.2"
|
||||
matrix:
|
||||
parameters:
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
- test_ios_rntester:
|
||||
run_unit_tests: true
|
||||
use_frameworks: "StaticLibraries"
|
||||
ruby_version: "2.6.10"
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
matrix:
|
||||
parameters:
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
architecture: ["NewArch", "OldArch"]
|
||||
@@ -0,0 +1,58 @@
|
||||
tests_android:
|
||||
when:
|
||||
and:
|
||||
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
jobs:
|
||||
- prepare_release:
|
||||
name: "prepare_release (dry run test)"
|
||||
version: "0.0.0"
|
||||
monorepo_packages_version: "0.0.0"
|
||||
tag: test
|
||||
dry_run: true
|
||||
- prepare_hermes_workspace
|
||||
- build_android:
|
||||
release_type: "dry-run"
|
||||
- build_hermesc_linux:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_hermesc_apple:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_apple_slices_hermes:
|
||||
requires:
|
||||
- build_hermesc_apple
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
|
||||
- build_hermes_macos:
|
||||
requires:
|
||||
- build_apple_slices_hermes
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
- build_hermesc_windows:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_npm_package:
|
||||
# Build a release package on every untagged commit, but do not publish to npm.
|
||||
release_type: "dry-run"
|
||||
requires:
|
||||
- build_android
|
||||
- build_hermesc_linux
|
||||
- build_hermes_macos
|
||||
- build_hermesc_windows
|
||||
## Disabled to land removing react-native/template. Re-enable once switched over
|
||||
## to Helloworld.
|
||||
# - test_android:
|
||||
# requires:
|
||||
# - build_android
|
||||
# - test_android_template:
|
||||
# requires:
|
||||
# - build_npm_package
|
||||
# matrix:
|
||||
# parameters:
|
||||
# architecture: ["NewArch", "OldArch"]
|
||||
# jsengine: ["Hermes", "JSC"]
|
||||
# flavor: ["Debug", "Release"]
|
||||
@@ -0,0 +1,9 @@
|
||||
tests_e2e:
|
||||
when:
|
||||
and:
|
||||
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
jobs:
|
||||
- test_e2e_ios:
|
||||
ruby_version: "2.7.8"
|
||||
- test_e2e_android
|
||||
@@ -0,0 +1,86 @@
|
||||
test_ios:
|
||||
when:
|
||||
and:
|
||||
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
jobs:
|
||||
- prepare_release:
|
||||
name: "prepare_release (dry run test)"
|
||||
version: "0.0.0"
|
||||
monorepo_packages_version: "0.0.0"
|
||||
tag: test
|
||||
dry_run: true
|
||||
- prepare_hermes_workspace
|
||||
- build_android:
|
||||
release_type: "dry-run"
|
||||
- build_hermesc_linux:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_hermesc_apple:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_apple_slices_hermes:
|
||||
requires:
|
||||
- build_hermesc_apple
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
|
||||
- build_hermes_macos:
|
||||
requires:
|
||||
- build_apple_slices_hermes
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
- build_hermesc_windows:
|
||||
requires:
|
||||
- prepare_hermes_workspace
|
||||
- build_npm_package:
|
||||
# Build a release package on every untagged commit, but do not publish to npm.
|
||||
release_type: "dry-run"
|
||||
requires:
|
||||
- build_android
|
||||
- build_hermesc_linux
|
||||
- build_hermes_macos
|
||||
- build_hermesc_windows
|
||||
- test_ios_helloworld:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
name: "Test Template with Ruby 3.2.2"
|
||||
ruby_version: "3.2.2"
|
||||
architecture: "NewArch"
|
||||
flavor: "Debug"
|
||||
jsengine: "Hermes"
|
||||
use_frameworks: "StaticLibraries"
|
||||
- test_ios_helloworld:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
matrix:
|
||||
parameters:
|
||||
flavor: ["Debug", "Release"]
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
|
||||
exclude:
|
||||
# This config is tested with Ruby 3.2.2. Let's not double test it.
|
||||
- flavor: "Debug"
|
||||
jsengine: "Hermes"
|
||||
use_frameworks: "StaticLibraries"
|
||||
- test_ios_rntester:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
use_frameworks: "DynamicFrameworks"
|
||||
ruby_version: "3.2.2"
|
||||
architecture: "NewArch"
|
||||
matrix:
|
||||
parameters:
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
- test_ios_rntester:
|
||||
run_unit_tests: true
|
||||
use_frameworks: "StaticLibraries"
|
||||
ruby_version: "2.6.10"
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
matrix:
|
||||
parameters:
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
architecture: ["NewArch", "OldArch"]
|
||||
@@ -0,0 +1,11 @@
|
||||
tests_js:
|
||||
when:
|
||||
and:
|
||||
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
jobs:
|
||||
- test_js:
|
||||
run_disabled_tests: false
|
||||
- test_js:
|
||||
name: test_js_prev_lts
|
||||
executor: nodeprevlts
|
||||
@@ -0,0 +1,149 @@
|
||||
version: 2.1
|
||||
|
||||
# -------------------------
|
||||
# ORBS
|
||||
# -------------------------
|
||||
|
||||
orbs:
|
||||
win: circleci/windows@2.4.0
|
||||
android: circleci/android@2.3.0
|
||||
|
||||
# -------------------------
|
||||
# REFERENCES
|
||||
# -------------------------
|
||||
references:
|
||||
defaults: &defaults
|
||||
working_directory: ~/react-native
|
||||
environment:
|
||||
- GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1
|
||||
# The public github tokens are publicly visible by design
|
||||
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: &github_analysisbot_token_a "312d354b5c36f082cfe9"
|
||||
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: &github_analysisbot_token_b "07973d757026bdd9f196"
|
||||
# Homebrew currently breaks while updating:
|
||||
# https://discuss.circleci.com/t/brew-install-fails-while-updating/32992
|
||||
- HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
android-defaults: &android-defaults
|
||||
working_directory: ~/react-native
|
||||
docker:
|
||||
- image: reactnativecommunity/react-native-android:v13.0
|
||||
environment:
|
||||
- TERM: "dumb"
|
||||
- GRADLE_OPTS: '-Dorg.gradle.daemon=false'
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
|
||||
- ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
|
||||
# Repeated here, as the environment key in this executor will overwrite the one in defaults
|
||||
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: *github_analysisbot_token_a
|
||||
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: *github_analysisbot_token_b
|
||||
|
||||
hermes_workspace_root: &hermes_workspace_root
|
||||
/tmp/hermes
|
||||
hermes_tarball_artifacts_dir: &hermes_tarball_artifacts_dir
|
||||
/tmp/hermes/hermes-runtime-darwin
|
||||
hermes_osxbin_artifacts_dir: &hermes_osxbin_artifacts_dir
|
||||
/tmp/hermes/osx-bin
|
||||
attach_hermes_workspace: &attach_hermes_workspace
|
||||
attach_workspace:
|
||||
at: *hermes_workspace_root
|
||||
xcodebuild_derived_data_path: &xcodebuild_derived_data_path
|
||||
~/Library/Developer/Xcode/DerivedData/
|
||||
|
||||
main_or_stable_only: &main_or_stable_only
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- /0\.[0-9]+[\.[0-9]+]?-stable/
|
||||
|
||||
|
||||
# -------------------------
|
||||
# Dependency Anchors
|
||||
# -------------------------
|
||||
dependency_versions:
|
||||
xcode_version: &xcode_version "15.2"
|
||||
nodelts_image: &nodelts_image "cimg/node:20.2.0"
|
||||
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.18.2"
|
||||
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"
|
||||
|
||||
# -------------------------
|
||||
# Cache Key Anchors
|
||||
# -------------------------
|
||||
# Anchors for the cache keys
|
||||
|
||||
cache_keys:
|
||||
checkout_cache_key: &checkout_cache_key v1-checkout
|
||||
gems_cache_key: &gems_cache_key v2-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
||||
gradle_cache_key: &gradle_cache_key v3-gradle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "packages/react-native/ReactAndroid/gradle.properties" }}
|
||||
yarn_cache_key: &yarn_cache_key v6-yarn-cache-{{ .Environment.CIRCLE_JOB }}
|
||||
rbenv_cache_key: &rbenv_cache_key v1-rbenv-{{ arch }}-{{ checksum "/tmp/required_ruby" }}
|
||||
hermes_workspace_cache_key: &hermes_workspace_cache_key v5-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
|
||||
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
|
||||
hermes_linux_cache_key: &hermes_linux_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_windows_cache_key: &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
# Hermes iOS
|
||||
hermesc_apple_cache_key: &hermesc_apple_cache_key v4-hermesc-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_apple_slices_cache_key: &hermes_apple_slices_cache_key v8-hermes-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
|
||||
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v6-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
|
||||
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v5-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
|
||||
hermes_macosx_bin_release_cache_key: &hermes_macosx_bin_release_cache_key v5-hermes-release-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_macosx_bin_debug_cache_key: &hermes_macosx_bin_debug_cache_key v3-hermes-debug-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_dsym_debug_cache_key: &hermes_dsym_debug_cache_key v3-hermes-debug-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v3-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
# Cocoapods - RNTester
|
||||
pods_cache_key: &pods_cache_key v12-pods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
|
||||
cocoapods_cache_key: &cocoapods_cache_key v12-cocoapods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v11-podfilelock-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
# Cocoapods - HelloWorld
|
||||
helloworld_cocoapods_cache_key: &helloworld_cocoapods_cache_key v2-cocoapods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/helloworld/ios/Podfile.lock" }}-{{ checksum "packages/helloworld/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
helloworld_podfile_lock_cache_key: &helloworld_podfile_lock_cache_key v2-podfilelock-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/helloworld/ios/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
|
||||
cache_paths:
|
||||
hermes_workspace_macos_cache_paths: &hermes_workspace_macos_cache_paths
|
||||
- ~/react-native/packages/react-native/sdks/hermes/build_macosx
|
||||
- ~/react-native/packages/react-native/sdks/hermes/destroot
|
||||
hermes_tarball_cache_paths: &hermes_tarball_cache_paths
|
||||
- *hermes_tarball_artifacts_dir
|
||||
|
||||
# -------------------------
|
||||
# Filters
|
||||
# -------------------------
|
||||
# CircleCI filters are OR-ed, with all branches triggering by default and tags excluded by default
|
||||
# CircleCI env-vars are only set with the branch OR tag that triggered the job, not both.
|
||||
|
||||
# In this case, CIRCLE_BRANCH is unset, but CIRCLE_TAG is set.
|
||||
only_release_tags: &only_release_tags
|
||||
# Both of the following conditions must be included!
|
||||
# Ignore any commit on any branch by default.
|
||||
branches:
|
||||
ignore: /.*/
|
||||
# Only act on version tags.
|
||||
tags:
|
||||
only: /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
|
||||
|
||||
# -------------------------
|
||||
# PIPELINE PARAMETERS
|
||||
# -------------------------
|
||||
parameters:
|
||||
run_release_workflow:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
run_nightly_workflow:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
release_version:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
release_monorepo_packages_version:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
release_tag:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
release_dry_run:
|
||||
default: false
|
||||
type: boolean
|
||||
@@ -0,0 +1,28 @@
|
||||
# -------------------------
|
||||
# WORKFLOWS
|
||||
#
|
||||
# When creating a new workflow, make sure to include condition:
|
||||
#
|
||||
# when:
|
||||
# and:
|
||||
# - equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
# - equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
#
|
||||
# It's setup this way so we can trigger a release via a POST
|
||||
# See limitations: https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2
|
||||
# -------------------------
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
analysis:
|
||||
when:
|
||||
and:
|
||||
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
|
||||
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
|
||||
jobs:
|
||||
# Run lints on every commit
|
||||
- analyze_code
|
||||
|
||||
# Run code checks on PRs
|
||||
- analyze_pr
|
||||
@@ -9,3 +9,12 @@ end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.gradle]
|
||||
indent_size = 4
|
||||
|
||||
[*.kts]
|
||||
indent_size = 4
|
||||
|
||||
[BUCK]
|
||||
indent_size = 4
|
||||
|
||||
+1
-2
@@ -3,16 +3,15 @@
|
||||
docs/generatedComponentApiDocs.js
|
||||
packages/react-native/flow/
|
||||
packages/react-native/sdks/
|
||||
packages/react-native/ReactAndroid/build
|
||||
packages/react-native/ReactAndroid/hermes-engine/build/
|
||||
packages/react-native/Libraries/Renderer/*
|
||||
packages/react-native/Libraries/vendor/**/*
|
||||
node_modules/
|
||||
packages/*/node_modules
|
||||
packages/*/dist
|
||||
packages/*/types_generated
|
||||
packages/debugger-frontend/dist/**/*
|
||||
packages/react-native-codegen/lib
|
||||
tools/eslint/rules/sort-imports.js
|
||||
**/Pods/*
|
||||
**/*.macos.js
|
||||
**/*.windows.js
|
||||
|
||||
+22
-46
@@ -4,18 +4,21 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @noflow
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('node:path');
|
||||
|
||||
require('eslint-plugin-lint').load(path.join(__dirname, 'tools/eslint/rules'));
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
|
||||
extends: ['@react-native'],
|
||||
|
||||
plugins: ['@react-native/monorepo', '@react-native/specs'],
|
||||
plugins: ['@react-native/eslint-plugin-specs', 'lint'],
|
||||
|
||||
overrides: [
|
||||
// overriding the JS config from @react-native/eslint-config to ensure
|
||||
@@ -24,34 +27,18 @@ module.exports = {
|
||||
files: ['*.js', '*.js.flow', '*.jsx'],
|
||||
parser: 'hermes-eslint',
|
||||
rules: {
|
||||
'@react-native/monorepo/sort-imports': 'warn',
|
||||
'eslint-comments/no-unlimited-disable': 'off',
|
||||
'ft-flow/require-valid-file-annotation': ['error', 'always'],
|
||||
'no-extra-boolean-cast': 'off',
|
||||
'no-void': 'off',
|
||||
// These rules are not required with hermes-eslint
|
||||
'ft-flow/define-flow-type': 'off',
|
||||
'ft-flow/use-flow-type': 'off',
|
||||
// Flow handles these checks for us, so they aren't required
|
||||
'no-undef': 'off',
|
||||
'no-unreachable': 'off',
|
||||
'ft-flow/define-flow-type': 0,
|
||||
'ft-flow/use-flow-type': 0,
|
||||
// flow handles this check for us, so it's not required
|
||||
'no-undef': 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
|
||||
files: ['*.js', '*.js.flow'],
|
||||
excludedFiles: ['packages/react-native/template/**/*'],
|
||||
rules: {
|
||||
'@react-native/no-deep-imports': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'./packages/react-native/Libraries/**/*.{js,flow}',
|
||||
'./packages/react-native/src/**/*.{js,flow}',
|
||||
'./packages/assets/registry.js',
|
||||
],
|
||||
parser: 'hermes-eslint',
|
||||
rules: {
|
||||
'@react-native/monorepo/no-commonjs-exports': 'warn',
|
||||
'lint/sort-imports': 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -61,17 +48,15 @@ module.exports = {
|
||||
{
|
||||
files: ['package.json'],
|
||||
rules: {
|
||||
'@react-native/monorepo/react-native-manifest': 'error',
|
||||
'lint/react-native-manifest': 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['flow-typed/**/*.js', 'packages/react-native/flow/**/*'],
|
||||
files: ['flow-typed/**/*.js'],
|
||||
rules: {
|
||||
'@react-native/monorepo/valid-flow-typed-signature': 'error',
|
||||
'ft-flow/require-valid-file-annotation': 'off',
|
||||
'no-shadow': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
quotes: 'off',
|
||||
'lint/valid-flow-typed-signature': 2,
|
||||
'no-unused-vars': 0,
|
||||
quotes: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -80,14 +65,11 @@ module.exports = {
|
||||
'packages/react-native/src/**/*.js',
|
||||
],
|
||||
rules: {
|
||||
'@react-native/monorepo/no-haste-imports': 'error',
|
||||
'@react-native/monorepo/no-react-default-imports': 'error',
|
||||
'@react-native/monorepo/no-react-named-type-imports': 'error',
|
||||
'@react-native/monorepo/no-react-native-imports': 'error',
|
||||
'@react-native/monorepo/no-react-node-imports': 'error',
|
||||
'@react-native/monorepo/require-extends-error': 'error',
|
||||
'@react-native/platform-colors': 'error',
|
||||
'@react-native/specs/react-native-modules': 'error',
|
||||
'@react-native/platform-colors': 2,
|
||||
'@react-native/specs/react-native-modules': 2,
|
||||
'lint/no-haste-imports': 2,
|
||||
'lint/no-react-native-imports': 2,
|
||||
'lint/require-extends-error': 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -138,11 +120,5 @@ module.exports = {
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/__tests__/**'],
|
||||
rules: {
|
||||
'@react-native/monorepo/no-react-native-imports': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
+6
-19
@@ -1,15 +1,13 @@
|
||||
[ignore]
|
||||
; Ignore build cache folder
|
||||
; Ignore templates for 'react-native init'
|
||||
<PROJECT_ROOT>/packages/react-native/template/.*
|
||||
<PROJECT_ROOT>/packages/react-native/sdks/.*
|
||||
|
||||
; Ignore fb_internal modules
|
||||
<PROJECT_ROOT>/packages/react-native/src/fb_internal/.*
|
||||
|
||||
; Ignore the codegen e2e tests
|
||||
<PROJECT_ROOT>/packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
|
||||
|
||||
; Ignore the Dangerfile
|
||||
<PROJECT_ROOT>/private/react-native-bots/dangerfile.js
|
||||
<PROJECT_ROOT>/packages/react-native-bots/dangerfile.js
|
||||
|
||||
; Ignore "BUCK" generated dirs
|
||||
<PROJECT_ROOT>/\.buckd/
|
||||
@@ -27,10 +25,7 @@
|
||||
<PROJECT_ROOT>/packages/.*/dist
|
||||
|
||||
; helloworld
|
||||
<PROJECT_ROOT>/private/helloworld/ios/Pods/
|
||||
|
||||
; Ignore rn-tester Pods
|
||||
<PROJECT_ROOT>/packages/rn-tester/Pods/
|
||||
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
|
||||
|
||||
[untyped]
|
||||
.*/node_modules/@react-native-community/cli/.*/.*
|
||||
@@ -47,9 +42,7 @@ packages/react-native/flow/
|
||||
|
||||
[options]
|
||||
enums=true
|
||||
experimental.pattern_matching=true
|
||||
casting_syntax=both
|
||||
component_syntax=true
|
||||
|
||||
emoji=true
|
||||
|
||||
@@ -69,11 +62,7 @@ munge_underscores=true
|
||||
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/packages/react-native/index.js'
|
||||
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-native/\1'
|
||||
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
|
||||
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
|
||||
|
||||
module.system.haste.module_ref_prefix=m#
|
||||
|
||||
react.runtime=automatic
|
||||
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
|
||||
|
||||
suppress_type=$FlowIssue
|
||||
suppress_type=$FlowFixMe
|
||||
@@ -81,8 +70,6 @@ suppress_type=$FlowFixMeProps
|
||||
suppress_type=$FlowFixMeState
|
||||
suppress_type=$FlowFixMeEmpty
|
||||
|
||||
ban_spread_key_props=true
|
||||
|
||||
[lints]
|
||||
sketchy-null-number=warn
|
||||
sketchy-null-mixed=warn
|
||||
@@ -104,4 +91,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.275.0
|
||||
^0.238.0
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
*.js.flow linguist-language=JavaScript
|
||||
@@ -1,4 +1,4 @@
|
||||
name: 🐛 React Native - Bug Report
|
||||
name: 🐛 Bug Report
|
||||
description: Report a reproducible bug or regression in React Native.
|
||||
labels: ["Needs: Triage :mag:"]
|
||||
body:
|
||||
@@ -19,10 +19,10 @@ body:
|
||||
* Please [search for similar issues](https://github.com/facebook/react-native/issues) in our issue tracker.
|
||||
|
||||
Make sure that your issue:
|
||||
* Have a **valid reproducer** (See [How to report a bug](https://reactnative.dev/contributing/how-to-report-a-bug)).
|
||||
* Have a **valid reproducer** (either a [Expo Snack](https://snack.expo.dev/) or a [empty project from template](https://github.com/react-native-community/reproducer-react-native).
|
||||
* Is tested against the [**latest stable**](https://github.com/facebook/react-native/releases/) of React Native.
|
||||
|
||||
🚨 IMPORTANT: Due to the extreme number of bugs we receive, issues **without a reproducer** or for an [**unsupported versions**](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) of React Native **will be closed**.
|
||||
Due to the extreme number of bugs we receive, we will be looking **ONLY** into issues with a reproducer, and on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) of React Native.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
@@ -69,10 +69,10 @@ body:
|
||||
- type: textarea
|
||||
id: react-native-info
|
||||
attributes:
|
||||
label: Output of `npx @react-native-community/cli info`
|
||||
description: Run `npx @react-native-community/cli info` in your terminal, copy and paste the results here.
|
||||
label: Output of `npx react-native info`
|
||||
description: Run `npx react-native info` in your terminal, copy and paste the results here.
|
||||
placeholder: |
|
||||
Paste the output of `npx @react-native-community/cli info` here. The output looks like:
|
||||
Paste the output of `npx react-native info` here. The output looks like:
|
||||
...
|
||||
System:
|
||||
OS: macOS 14.1.1
|
||||
@@ -83,7 +83,7 @@ body:
|
||||
path: /bin/zsh
|
||||
Binaries:
|
||||
Node: ...
|
||||
version: 22.14.0
|
||||
version: 18.14.0
|
||||
...
|
||||
render: text
|
||||
validations:
|
||||
@@ -109,8 +109,8 @@ body:
|
||||
- type: input
|
||||
id: reproducer
|
||||
attributes:
|
||||
label: MANDATORY Reproducer
|
||||
description: A link to either a failing RNTesterPlayground.js file, an Expo Snack or a public repository from [this template](https://github.com/react-native-community/reproducer-react-native) that reproduces this bug. Reproducers are **mandatory**, issues without a reproducer will be closed.
|
||||
label: Reproducer
|
||||
description: A link to a Expo Snack or a public repository that reproduces this bug, using [this template](https://github.com/react-native-community/reproducer-react-native). Reproducers are **mandatory**.
|
||||
placeholder: "https://github.com/<myuser>/<myreproducer>"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
name: 🔍 Debugger - Bug Report
|
||||
description: Report a bug with React Native DevTools and the New Debugger
|
||||
labels: ["Needs: Triage :mag:", "Debugger"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "## Reporting a bug for React Native DevTools"
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for taking the time to report an issue for React Native DevTools, our new Debugger for React Native.
|
||||
|
||||
Before you continue:
|
||||
* If you're using **Expo** and you're noticing a bug, [report it here](https://github.com/expo/expo/issues).
|
||||
* If you've found a problem with our **documentation**, [report it here](https://github.com/facebook/react-native-website/issues/).
|
||||
* If you're having an issue with **Metro** (the bundler), [report it here](https://github.com/facebook/metro/issues/).
|
||||
* If you're using an external library, report the issue to the **library first**.
|
||||
* Please [search for similar issues](https://github.com/facebook/react-native/issues) in our issue tracker.
|
||||
|
||||
Make sure that your issue is tested against the [**latest stable**](https://github.com/facebook/react-native/releases/) of React Native.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A clear and concise description of what the bug is.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: The list of steps that reproduces the issue.
|
||||
placeholder: |
|
||||
1. Install the application with `yarn android`
|
||||
2. Press `j` to open the debugger
|
||||
3. Do something...
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: React Native Version
|
||||
description: The version of react-native that this issue reproduces on. Bear in mind that only issues on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) will be looked into.
|
||||
placeholder: "0.76.0"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: react-native-info
|
||||
attributes:
|
||||
label: Output of `npx @react-native-community/cli info`
|
||||
description: Run `npx @react-native-community/cli info` in your terminal, copy and paste the results here.
|
||||
placeholder: |
|
||||
Paste the output of `npx @react-native-community/cli info` here. The output looks like:
|
||||
...
|
||||
System:
|
||||
OS: macOS 14.1.1
|
||||
CPU: (10) arm64 Apple M1 Max
|
||||
Memory: 417.81 MB / 64.00 GB
|
||||
Shell:
|
||||
version: "5.9"
|
||||
path: /bin/zsh
|
||||
Binaries:
|
||||
Node: ...
|
||||
version: 22.14.0
|
||||
...
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: Screenshots and Videos
|
||||
description: |
|
||||
Please provide screenshot or a video of your bug if relevant.
|
||||
Issues with videos and screenshots are more likely to **get prioritized**.
|
||||
@@ -16,10 +16,10 @@ body:
|
||||
Do not attempt to open a bug in this category if you're not using the New Architecture as your bug will be closed.
|
||||
|
||||
Make sure that your issue:
|
||||
* Have a **valid reproducer** (See [How to report a bug](https://reactnative.dev/contributing/how-to-report-a-bug)).
|
||||
* Have a **valid reproducer** (either a [Expo Snack](https://snack.expo.dev/) or a [empty project from template](https://github.com/react-native-community/reproducer-react-native).
|
||||
* Is tested against the [**latest stable**](https://github.com/facebook/react-native/releases/) of React Native.
|
||||
|
||||
🚨 IMPORTANT: Due to the extreme number of bugs we receive, issues **without a reproducer** or for an [**unsupported versions**](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) of React Native **will be closed**.
|
||||
Due to the extreme number of bugs we receive, we will be looking **ONLY** into issues with a reproducer, and on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) of React Native.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
@@ -81,10 +81,10 @@ body:
|
||||
- type: textarea
|
||||
id: react-native-info
|
||||
attributes:
|
||||
label: Output of `npx @react-native-community/cli info`
|
||||
description: Run `npx @react-native-community/cli info` in your terminal, copy and paste the results here.
|
||||
label: Output of `npx react-native info`
|
||||
description: Run `npx react-native info` in your terminal, copy and paste the results here.
|
||||
placeholder: |
|
||||
Paste the output of `npx @react-native-community/cli info` here. The output looks like:
|
||||
Paste the output of `npx react-native info` here. The output looks like:
|
||||
...
|
||||
System:
|
||||
OS: macOS 14.1.1
|
||||
@@ -95,7 +95,7 @@ body:
|
||||
path: /bin/zsh
|
||||
Binaries:
|
||||
Node: ...
|
||||
version: 22.14.0
|
||||
version: 18.14.0
|
||||
...
|
||||
render: text
|
||||
validations:
|
||||
@@ -121,8 +121,8 @@ body:
|
||||
- type: input
|
||||
id: reproducer
|
||||
attributes:
|
||||
label: MANDATORY Reproducer
|
||||
description: A link to either a failing RNTesterPlayground.js file, an Expo Snack or a public repository from [this template](https://github.com/react-native-community/reproducer-react-native) that reproduces this bug. Reproducers are **mandatory**, issues without a reproducer will be closed.
|
||||
label: Reproducer
|
||||
description: A link to a Expo Snack or a public repository that reproduces this bug, using [this template](https://github.com/react-native-community/reproducer-react-native). Reproducers are **mandatory**.
|
||||
placeholder: "https://github.com/<myuser>/<myreproducer>"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
name: build-android
|
||||
description: This action builds android
|
||||
inputs:
|
||||
release-type:
|
||||
required: true
|
||||
description: The type of release we are building. It could be nightly, release or dry-run
|
||||
run-e2e-tests:
|
||||
default: 'false'
|
||||
description: If we need to build to run E2E tests. If yes, we need to build also x86.
|
||||
gradle-cache-encryption-key:
|
||||
description: "The encryption key needed to store the Gradle Configuration cache"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup git safe folders
|
||||
shell: bash
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install node dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Set React Native Version
|
||||
shell: bash
|
||||
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
with:
|
||||
cache-read-only: "false"
|
||||
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
|
||||
- name: Restore Android ccache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: /github/home/.cache/ccache
|
||||
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
|
||||
restore-keys: |
|
||||
v1-ccache-android-${{ github.job }}-
|
||||
v1-ccache-android-
|
||||
- name: Show ccache stats
|
||||
shell: bash
|
||||
run: ccache -s -v
|
||||
- name: Build and publish all the Android Artifacts to /tmp/maven-local
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
|
||||
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
|
||||
if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
|
||||
fi
|
||||
TASKS="publishAllToMavenTempLocal build"
|
||||
elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then
|
||||
# nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central.
|
||||
export ORG_GRADLE_PROJECT_isSnapshot="true"
|
||||
TASKS="publishAllToMavenTempLocal publishAndroidToSonatype build"
|
||||
else
|
||||
# release: we want to build all archs (default)
|
||||
TASKS="publishAllToMavenTempLocal publishAndroidToSonatype build"
|
||||
fi
|
||||
./gradlew $TASKS -PenableWarningsAsErrors=true
|
||||
- name: Save Android ccache
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: /github/home/.cache/ccache
|
||||
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
|
||||
- name: Show ccache stats
|
||||
shell: bash
|
||||
run: ccache -s -v
|
||||
- name: Upload Maven Artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: maven-local
|
||||
path: /tmp/maven-local
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
path: |
|
||||
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
|
||||
packages/react-native-gradle-plugin/settings-plugin/build/reports
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK - hermes-debug
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: rntester-debug
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/debug/
|
||||
compression-level: 0
|
||||
- name: Upload RNTester APK - hermes-release
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: rntester-release
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/release/
|
||||
compression-level: 0
|
||||
@@ -1,103 +0,0 @@
|
||||
name: build-apple-slices-hermes
|
||||
description: This action builds hermesc for Apple platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
slice:
|
||||
required: true
|
||||
description: The slice of hermes you want to build. It could be iphone, iphonesimulator, macos, catalyst, appletvos, appletvsimulator, xros, or xrossimulator
|
||||
flavor:
|
||||
required: true
|
||||
description: The flavor we want to build. It can be Debug or Release
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
|
||||
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.slice }}-${{ inputs.flavor }}
|
||||
- name: Build the Hermes ${{ inputs.slice }} frameworks
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
SLICE=${{ inputs.slice }}
|
||||
FLAVOR=${{ inputs.flavor }}
|
||||
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
|
||||
echo "Final path for this slice is: $FINAL_PATH"
|
||||
|
||||
if [[ -d "$FINAL_PATH" ]]; then
|
||||
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$ARTIFACTS_EXIST" ]]; then
|
||||
echo "[HERMES] Skipping! Artifacts exists already."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ inputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
echo "Moving from build_$SLICE to $FINAL_PATH"
|
||||
mv build_"$SLICE" "$FINAL_PATH"
|
||||
|
||||
# check whether everything is there
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
|
||||
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
|
||||
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Upload Artifact for Slice (${{ inputs.slice }}, ${{ inputs.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: slice-${{ inputs.slice }}-${{ inputs.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}.tar.gz
|
||||
- name: Save slice cache
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
|
||||
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.SLICE }}-${{ inputs.FLAVOR }}
|
||||
@@ -1,227 +0,0 @@
|
||||
name: build-hermes-macos
|
||||
description: This action builds hermesc for Apple platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: true
|
||||
description: The version of React Native
|
||||
flavor:
|
||||
required: true
|
||||
description: The flavor we want to build. It can be Debug or Release
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
/tmp/hermes/dSYM/${{ inputs.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
shell: bash
|
||||
run: |
|
||||
FLAVOR="${{ inputs.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Slice cache macosx
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-macosx-${{ inputs.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphoneos-${{ inputs.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphonesimulator-${{ inputs.flavor }}
|
||||
- name: Slice cache appletvos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-appletvos-${{ inputs.flavor }}
|
||||
- name: Slice cache appletvsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-appletvsimulator-${{ inputs.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ inputs.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xros-${{ inputs.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ inputs.flavor }}
|
||||
- name: Unzip slices
|
||||
shell: bash
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_appletvos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_appletvsimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
mv build_macosx_${{ inputs.flavor }} build_macosx
|
||||
mv build_iphoneos_${{ inputs.flavor }} build_iphoneos
|
||||
mv build_iphonesimulator_${{ inputs.flavor }} build_iphonesimulator
|
||||
mv build_appletvos_${{ inputs.flavor }} build_appletvos
|
||||
mv build_appletvsimulator_${{ inputs.flavor }} build_appletvsimulator
|
||||
mv build_catalyst_${{ inputs.flavor }} build_catalyst
|
||||
mv build_xros_${{ inputs.flavor }} build_xros
|
||||
mv build_xrsimulator_${{ inputs.flavor }} build_xrsimulator
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
|
||||
--inputDir ./packages/react-native/sdks/hermes \
|
||||
--buildType "$BUILD_TYPE" \
|
||||
--outputDir $TARBALL_OUTPUT_DIR)
|
||||
|
||||
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
|
||||
|
||||
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
|
||||
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
|
||||
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
FLAVOR=${{ inputs.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
|
||||
mkdir -p "$WORKING_DIR/macosx"
|
||||
mkdir -p "$WORKING_DIR/catalyst"
|
||||
mkdir -p "$WORKING_DIR/iphoneos"
|
||||
mkdir -p "$WORKING_DIR/iphonesimulator"
|
||||
mkdir -p "$WORKING_DIR/appletvos"
|
||||
mkdir -p "$WORKING_DIR/appletvsimulator"
|
||||
mkdir -p "$WORKING_DIR/xros"
|
||||
mkdir -p "$WORKING_DIR/xrsimulator"
|
||||
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
|
||||
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
|
||||
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
|
||||
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
|
||||
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
|
||||
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
|
||||
cp -r build_appletvos/$DSYM_FILE_PATH "$WORKING_DIR/appletvos/"
|
||||
cp -r build_appletvsimulator/$DSYM_FILE_PATH "$WORKING_DIR/appletvsimulator/"
|
||||
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
|
||||
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
|
||||
|
||||
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
|
||||
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
|
||||
|
||||
mkdir -p "$DEST_DIR"
|
||||
mv "hermes.framework.dSYM" "$DEST_DIR"
|
||||
- name: Upload hermes dSYM artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-dSYM-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ inputs.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-osx-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
/tmp/hermes/dSYM/${{ inputs.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
|
||||
@@ -1,39 +0,0 @@
|
||||
name: build-hermesc-apple
|
||||
description: This action builds hermesc for Apple platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: true
|
||||
description: The version of React Native
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
- name: Build HermesC Apple
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
@@ -1,53 +0,0 @@
|
||||
name: build-hermesc-linux
|
||||
description: This action builds hermesc for linux platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: True
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: True
|
||||
description: The version of React Native
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
|
||||
# Install cmake 3.28.3-1build7
|
||||
sudo apt-get install cmake=3.28.3-1build7
|
||||
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v1-hermes-${{ github.job }}-linux-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/linux64-bin/
|
||||
/tmp/hermes/hermes/destroot/
|
||||
- name: Set up workspace
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p /tmp/hermes/linux64-bin
|
||||
- name: Build HermesC for Linux
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
|
||||
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
|
||||
else
|
||||
cd /tmp/hermes
|
||||
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
|
||||
cmake --build build --target hermesc -j 4
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -1,86 +0,0 @@
|
||||
name: build-hermesc-windows
|
||||
description: This action builds hermesc for Windows platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: True
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: True
|
||||
description: The version of React Native
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: 'C:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
mkdir -p C:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force C:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
C:\tmp\hermes\win64-bin\
|
||||
C:\tmp\hermes\hermes\icu\
|
||||
C:\tmp\hermes\hermes\deps\
|
||||
C:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
|
||||
- name: Downgrade CMake
|
||||
shell: powershell
|
||||
run: choco install cmake --version 3.31.6 --force
|
||||
- name: Build HermesC for Windows
|
||||
shell: powershell
|
||||
run: |
|
||||
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
|
||||
cd $Env:HERMES_WS_DIR\icu
|
||||
# If Invoke-WebRequest shows a progress bar, it will fail with
|
||||
# Win32 internal error "Access is denied" 0x5 occurred [...]
|
||||
$progressPreference = 'silentlyContinue'
|
||||
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
|
||||
Expand-Archive -Path "icu.zip" -DestinationPath "."
|
||||
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
|
||||
# Include MSVC++ 2015 redistributables
|
||||
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
|
||||
|
||||
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
|
||||
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
|
||||
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 17 2022' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
if (-not $?) { throw "Failed to configure Hermes" }
|
||||
echo "Running windows build..."
|
||||
cd build_release
|
||||
cmake --build . --target hermesc --config Release
|
||||
if (-not $?) { throw "Failed to build Hermes" }
|
||||
|
||||
echo "Copying hermesc.exe to win64-bin"
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
|
||||
# Include Windows runtime dependencies
|
||||
Copy-Item -Path "deps\*" -Destination "win64-bin"
|
||||
}
|
||||
else {
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: C:\tmp\hermes\win64-bin\
|
||||
@@ -1,171 +0,0 @@
|
||||
name: build-npm-package
|
||||
description: This action builds the NPM package and uploads it to Maven
|
||||
inputs:
|
||||
release-type:
|
||||
required: true
|
||||
description: The type of release we are building. It could be nightly, release or dry-run
|
||||
hermes-ws-dir:
|
||||
required: 'true'
|
||||
description: The workspace for hermes
|
||||
gha-npm-token:
|
||||
required: false
|
||||
description: The GHA npm token, required only to publish to npm
|
||||
default: ''
|
||||
gradle-cache-encryption-key:
|
||||
description: The encryption key needed to store the Gradle Configuration cache
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup git safe folders
|
||||
shell: bash
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Create /tmp/hermes/osx-bin directory
|
||||
shell: bash
|
||||
run: mkdir -p /tmp/hermes/osx-bin
|
||||
- name: Download osx-bin release artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-Release
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download darwin-bin debug artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-Debug
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download hermes dSYM debug artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-dSYM-Debug
|
||||
path: /tmp/hermes/dSYM/Debug
|
||||
- name: Download hermes dSYM release vartifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-dSYM-Release
|
||||
path: /tmp/hermes/dSYM/Release
|
||||
- name: Download windows-bin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: /tmp/hermes/win64-bin
|
||||
- name: Download linux-bin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
- name: Show /tmp/hermes directory
|
||||
shell: bash
|
||||
run: ls -lR /tmp/hermes
|
||||
- name: Copy Hermes binaries
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
|
||||
|
||||
# When build_hermes_macos runs as a matrix, it outputs
|
||||
if [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Release ]]; then
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
elif [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Debug ]]; then
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
else
|
||||
ls ${{ inputs.hermes-ws-dir }}/osx-bin || echo "hermesc macOS artifacts directory missing."
|
||||
echo "Could not locate macOS hermesc binary."; exit 1;
|
||||
fi
|
||||
|
||||
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
|
||||
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
|
||||
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
|
||||
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
|
||||
fi
|
||||
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
|
||||
|
||||
# Make sure the hermesc files are actually executable.
|
||||
chmod -R +x packages/react-native/sdks/hermesc/*
|
||||
|
||||
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
|
||||
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
|
||||
cp ${{ inputs.hermes-ws-dir }}/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
|
||||
cp ${{ inputs.hermes-ws-dir }}/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: ReactNativeDependencies*
|
||||
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
|
||||
merge-multiple: true
|
||||
- name: Download ReactCore artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: ReactCore*
|
||||
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
|
||||
merge-multiple: true
|
||||
- name: Print Artifacts Directory
|
||||
shell: bash
|
||||
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
with:
|
||||
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Build packages
|
||||
shell: bash
|
||||
run: yarn build
|
||||
- name: Build types
|
||||
shell: bash
|
||||
run: yarn build-types --skip-snapshot
|
||||
# Continue with publish steps
|
||||
- name: Set npm credentials
|
||||
if: ${{ inputs.release-type == 'release' ||
|
||||
inputs.release-type == 'nightly' }}
|
||||
shell: bash
|
||||
run: echo "//registry.npmjs.org/:_authToken=${{ inputs.gha-npm-token }}" > ~/.npmrc
|
||||
- name: Publish NPM
|
||||
shell: bash
|
||||
run: |
|
||||
echo "GRADLE_OPTS = $GRADLE_OPTS"
|
||||
# We can't have a separate step because each command is executed in a separate shell
|
||||
# so variables exported in a command are not visible in another.
|
||||
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
|
||||
fi
|
||||
node ./scripts/releases-ci/publish-npm.js -t ${{ inputs.release-type }}
|
||||
- name: Upload npm logs
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: npm-logs
|
||||
path: ~/.npm/_logs
|
||||
- name: Build release package as a job artifact
|
||||
if: ${{ inputs.release-type == 'dry-run' }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
|
||||
FILENAME=$(cd packages/react-native; npm pack | tail -1)
|
||||
mv "packages/react-native/$FILENAME" build/
|
||||
|
||||
echo "$FILENAME" > build/react-native-package-version
|
||||
- name: Upload release package
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
if: ${{ inputs.release-type == 'dry-run' }}
|
||||
with:
|
||||
name: react-native-package
|
||||
path: build
|
||||
@@ -0,0 +1,88 @@
|
||||
name: cache_setup
|
||||
description: "Cache setup"
|
||||
inputs:
|
||||
hermes-version:
|
||||
description: "Hermes version"
|
||||
required: true
|
||||
react-native-version:
|
||||
description: "React Native version"
|
||||
required: true
|
||||
outputs:
|
||||
cache-hit-hermes-tarball-release:
|
||||
description: "Whether the hermes tarball release cache was hit"
|
||||
value: ${{ steps.cache_hermes_tarball_release.outputs.cache-hit }}
|
||||
cache-hit-hermes-tarball-debug:
|
||||
description: "Whether the hermes tarball debug cache was hit"
|
||||
value: ${{ steps.cache_hermes_tarball_debug.outputs.cache-hit }}
|
||||
cache-hit-macos-bin-release:
|
||||
description: "Whether the macos bin release cache was hit"
|
||||
value: ${{ steps.cache_macos_bin_release.outputs.cache-hit }}
|
||||
cache-hit-macos-bin-debug:
|
||||
description: "Whether the macos bin debug cache was hit"
|
||||
value: ${{ steps.cache_macos_bin_debug.outputs.cache-hit }}
|
||||
cache-hit-dsym-release:
|
||||
description: "Whether the dsym release cache was hit"
|
||||
value: ${{ steps.cache_dsym_release.outputs.cache-hit }}
|
||||
cache-hit-dsym-debug:
|
||||
description: "Whether the dsym debug cache was hit"
|
||||
value: ${{ steps.cache_dsym_debug.outputs.cache-hit }}
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Cache hermes tarball release
|
||||
id: cache_hermes_tarball_release
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Release.tar.gz
|
||||
key: v4-hermes-tarball-release-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Cache hermes tarball debug
|
||||
id: cache_hermes_tarball_debug
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Debug.tar.gz
|
||||
key: v4-hermes-tarball-debug-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Cache macos bin release
|
||||
id: cache_macos_bin_release
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
key: v2-hermes-release-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Cache macos bin debug
|
||||
id: cache_macos_bin_debug
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
key: v2-hermes-debug-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Cache dsym release
|
||||
id: cache_dsym_release
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/dSYM/Release
|
||||
key: v2-hermes-release-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Cache dsym debug
|
||||
id: cache_dsym_debug
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/dSYM/Debug
|
||||
key: v2-hermes-debug-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
- name: HermesC Apple
|
||||
id: hermesc_apple
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: /tmp/hermes/hermesc-apple
|
||||
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ inputs.hermes-version }}
|
||||
enableCrossOsArchive: true
|
||||
@@ -4,18 +4,19 @@ inputs:
|
||||
version:
|
||||
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
|
||||
required: true
|
||||
is-latest-on-npm:
|
||||
is_latest_on_npm:
|
||||
description: "Whether we want to tag this release as latest on NPM"
|
||||
required: true
|
||||
default: "false"
|
||||
dry-run:
|
||||
dry_run:
|
||||
description: "Whether the job should be executed in dry-run mode or not"
|
||||
default: "true"
|
||||
default: "false"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
- name: Configure Git
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -26,19 +27,19 @@ runs:
|
||||
run: |
|
||||
node scripts/releases/create-release-commit.js \
|
||||
--reactNativeVersion "${{ inputs.version }}" \
|
||||
--tagAsLatestRelease "${{ inputs.is-latest-on-npm }}" \
|
||||
--dryRun "${{ inputs.dry-run }}"
|
||||
--tagAsLatestRelease "${{ inputs.is_latest_on_npm }}" \
|
||||
--dryRun "${{ inputs.dry_run }}"
|
||||
GIT_PAGER=cat git show HEAD
|
||||
- name: Update "latest" tag if needed
|
||||
shell: bash
|
||||
if: ${{ inputs.is-latest-on-npm == 'true' }}
|
||||
if: ${{ inputs.is_latest_on_npm == 'true' }}
|
||||
run: |
|
||||
git tag -d "latest"
|
||||
git push origin :latest
|
||||
git tag -a "latest" -m "latest"
|
||||
- name: Pushing release commit
|
||||
shell: bash
|
||||
if: ${{ inputs.dry-run == 'false' }}
|
||||
if: ${{ inputs.dry_run == 'false' }}
|
||||
run: |
|
||||
CURR_BRANCH="$(git branch --show-current)"
|
||||
git push origin "$CURR_BRANCH" --follow-tags
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
name: diff-js-api-breaking-changes
|
||||
description: Check for breaking changes in the public React Native JS API
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Fetch snapshot from PR head
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
|
||||
run: |
|
||||
mkdir $SCRATCH_DIR
|
||||
git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
|
||||
git show ${{ github.event.pull_request.head.sha }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
|| echo "" > $SCRATCH_DIR/ReactNativeApi.d.ts
|
||||
- name: Run breaking change detection
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
|
||||
run: |
|
||||
node ./scripts/js-api/diff-api-snapshot \
|
||||
${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \
|
||||
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
> $SCRATCH_DIR/output.json
|
||||
@@ -1,55 +0,0 @@
|
||||
name: lint
|
||||
description: Runs all the linters in the codebase
|
||||
inputs:
|
||||
node-version:
|
||||
description: "The node.js version to use"
|
||||
required: false
|
||||
default: "22"
|
||||
github-token:
|
||||
description: "The GitHub token used by pull-bot"
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Run linters against modified files (analysis-bot)
|
||||
shell: bash
|
||||
run: yarn lint-ci
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ inputs.github-token }}
|
||||
GITHUB_PR_NUMBER: ${{ github.event.number }}
|
||||
- name: Lint code
|
||||
shell: bash
|
||||
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
|
||||
- name: Lint file structure
|
||||
shell: bash
|
||||
run: ./.github/workflow-scripts/lint_files.sh
|
||||
- name: Verify not committing repo after running build
|
||||
shell: bash
|
||||
run: yarn run build --validate
|
||||
- name: Run flowcheck
|
||||
shell: bash
|
||||
run: yarn flow-check
|
||||
- name: Run typescript check
|
||||
shell: bash
|
||||
run: yarn test-typescript
|
||||
- name: Check license
|
||||
shell: bash
|
||||
run: ./.github/workflow-scripts/check_license.sh
|
||||
- name: Check formatting
|
||||
shell: bash
|
||||
run: yarn run format-check
|
||||
- name: Lint markdown
|
||||
shell: bash
|
||||
run: yarn run lint-markdown
|
||||
- name: Build types
|
||||
shell: bash
|
||||
run: yarn build-types --skip-snapshot
|
||||
- name: Run typescript check of generated types
|
||||
shell: bash
|
||||
run: yarn test-generated-typescript
|
||||
@@ -1,84 +0,0 @@
|
||||
name: Maestro E2E Android
|
||||
description: Runs E2E Tests on Android using Maestro
|
||||
inputs:
|
||||
app-path:
|
||||
required: true
|
||||
description: The path to the .apk file
|
||||
app-id:
|
||||
required: true
|
||||
description: The id of the app to test
|
||||
maestro-flow:
|
||||
required: true
|
||||
description: the folder that contains the maestro tests
|
||||
install-java:
|
||||
required: false
|
||||
default: 'true'
|
||||
description: whether this action has to install java 17 or not
|
||||
flavor:
|
||||
required: true
|
||||
description: the flavor we want to run - either debug or release
|
||||
default: release
|
||||
working-directory:
|
||||
required: false
|
||||
default: "."
|
||||
description: The directory from which metro should be started
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Installing Maestro
|
||||
shell: bash
|
||||
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
- name: Set up JDK 17
|
||||
if: ${{ inputs.install-java == 'true' }}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Enable KVM group perms
|
||||
shell: bash
|
||||
run: |
|
||||
# ubuntu machines have hardware acceleration available and when we try to create an emulator, the script pauses asking for user input
|
||||
# These lines set the rules to reply automatically to that question and unblock the creation of the emulator.
|
||||
# source: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
- name: Build Codegen
|
||||
shell: bash
|
||||
if: ${{ inputs.flavor == 'debug' }}
|
||||
run: ./packages/react-native-codegen/scripts/oss/build.sh
|
||||
- name: Run e2e tests
|
||||
id: run-tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 24
|
||||
arch: x86
|
||||
ram-size: '8192M'
|
||||
heap-size: '4096M'
|
||||
disk-size: '10G'
|
||||
cores: '4'
|
||||
disable-animations: false
|
||||
avd-name: e2e_emulator
|
||||
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }}
|
||||
- name: Normalize APP_ID
|
||||
id: normalize-app-id
|
||||
shell: bash
|
||||
if: always()
|
||||
run: |
|
||||
NORM_APP_ID=$(echo "${{ inputs.app-id }}" | tr '.' '-')
|
||||
echo "app-id=$NORM_APP_ID" >> $GITHUB_OUTPUT
|
||||
- name: Store tests result
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
if: always()
|
||||
with:
|
||||
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.flavor }}_NewArch
|
||||
path: |
|
||||
report.xml
|
||||
screen.mp4
|
||||
- name: Store Logs
|
||||
if: steps.run-tests.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.flavor }}-NewArch
|
||||
path: /tmp/MaestroLogs
|
||||
@@ -1,82 +0,0 @@
|
||||
name: Maestro E2E iOS
|
||||
description: Runs E2E Tests on iOS using Maestro
|
||||
inputs:
|
||||
app-path:
|
||||
required: true
|
||||
description: The path to the .app file
|
||||
app-id:
|
||||
required: true
|
||||
description: The id of the app to test
|
||||
maestro-flow:
|
||||
required: true
|
||||
description: the folder that contains the maestro tests
|
||||
flavor:
|
||||
required: true
|
||||
description: Whether we are building for Debug or Release
|
||||
default: Release
|
||||
working-directory:
|
||||
required: false
|
||||
default: "."
|
||||
description: The directory from which metro should be started
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Installing Maestro
|
||||
shell: bash
|
||||
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
- name: Installing Maestro dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
brew tap facebook/fb
|
||||
brew install facebook/fb/idb-companion
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Start Metro in Debug
|
||||
shell: bash
|
||||
if: ${{ inputs.flavor == 'Debug' }}
|
||||
run: |
|
||||
# build codegen or we will see a redbox
|
||||
./packages/react-native-codegen/scripts/oss/build.sh
|
||||
|
||||
cd ${{ inputs.working-directory }}
|
||||
yarn start &
|
||||
sleep 5 # to give metro time to load
|
||||
- name: Run tests
|
||||
id: run-tests
|
||||
shell: bash
|
||||
run: |
|
||||
# Avoid exit from the job if one of the command returns an error.
|
||||
# Maestro can fail in case of flakyness, we have some retry logic.
|
||||
set +e
|
||||
|
||||
node .github/workflow-scripts/maestro-ios.js \
|
||||
"${{ inputs.app-path }}" \
|
||||
"${{ inputs.app-id }}" \
|
||||
"${{ inputs.maestro-flow }}" \
|
||||
"Hermes" \
|
||||
"${{ inputs.flavor }}" \
|
||||
"${{ inputs.working-directory }}"
|
||||
- name: Store video record
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.flavor }}_NewArch
|
||||
path: |
|
||||
video_record_1.mov
|
||||
video_record_2.mov
|
||||
video_record_3.mov
|
||||
video_record_4.mov
|
||||
video_record_5.mov
|
||||
report.xml
|
||||
- name: Store Logs
|
||||
if: failure() && steps.run-tests.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.flavor }}-NewArch
|
||||
path: /tmp/MaestroLogs
|
||||
@@ -1,12 +1,15 @@
|
||||
name: prepare-hermes-workspace
|
||||
description: This action prepares the hermes workspace with the right hermes and react-native versions.
|
||||
inputs:
|
||||
hermes-ws-dir:
|
||||
HERMES_WS_DIR:
|
||||
required: true
|
||||
description: The hermes dir we need to use to setup the workspace
|
||||
hermes-version-file:
|
||||
HERMES_VERSION_FILE:
|
||||
required: true
|
||||
description: the path to the file that will contain the hermes version
|
||||
BUILD_FROM_SOURCE:
|
||||
description: Whether we need to build from source or not
|
||||
default: true
|
||||
outputs:
|
||||
hermes-version:
|
||||
description: the version of Hermes tied to this run
|
||||
@@ -26,9 +29,9 @@ runs:
|
||||
run: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "${{ inputs.hermes-version-file }}" ]; then
|
||||
if [ -f "$HERMES_VERSION_FILE" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
echo "VERSION=$(cat ${{ inputs.hermes-version-file }})" >> "$GITHUB_OUTPUT"
|
||||
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
@@ -48,7 +51,7 @@ runs:
|
||||
|
||||
- name: Cache hermes workspace
|
||||
id: restore-hermes
|
||||
uses: actions/cache/restore@v4
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
@@ -69,20 +72,21 @@ runs:
|
||||
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
uses: ./.github/actions/yarn-install
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
|
||||
- name: Download Hermes tarball
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
|
||||
cp packages/react-native/sdks/download/* ${{ inputs.hermes-ws-dir }}/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* ${{ inputs.hermes-ws-dir }}/hermes/.
|
||||
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
|
||||
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
|
||||
- name: Upload Hermes artifact
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: |
|
||||
@@ -90,7 +94,7 @@ runs:
|
||||
/tmp/hermes/hermes/
|
||||
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache/save@v4
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: |
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
name: prepare-ios-tests
|
||||
description: Prepare iOS Tests
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Run Ruby Tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/react-native/scripts
|
||||
sh run_ruby_tests.sh
|
||||
- name: Boot iPhone Simulator
|
||||
shell: bash
|
||||
run: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
|
||||
- name: "Brew: Tap wix/brew"
|
||||
shell: bash
|
||||
run: brew tap wix/brew
|
||||
- name: brew install applesimutils watchman
|
||||
shell: bash
|
||||
run: brew install applesimutils watchman
|
||||
- name: Configure Watchman
|
||||
shell: bash
|
||||
run: echo "{}" > .watchmanconfig
|
||||
@@ -0,0 +1,25 @@
|
||||
name: prepare_ios_tests
|
||||
description: Prepare iOS Tests
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: brew install xcbeautify
|
||||
run: brew install xcbeautify
|
||||
shell: bash
|
||||
- name: Run Ruby Tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/react-native/scripts
|
||||
sh run_ruby_tests.sh
|
||||
- name: Boot iPhone Simulator
|
||||
shell: bash
|
||||
run: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
|
||||
- name: "Brew: Tap wix/brew"
|
||||
shell: bash
|
||||
run: brew tap wix/brew
|
||||
- name: brew install applesimutils watchman
|
||||
shell: bash
|
||||
run: brew install applesimutils watchman
|
||||
- name: Configure Watchman
|
||||
shell: bash
|
||||
run: echo "{}" > .watchmanconfig
|
||||
@@ -0,0 +1,12 @@
|
||||
name: report_bundle_size
|
||||
description: Report bundle size
|
||||
inputs:
|
||||
platform:
|
||||
description: Platform. Either ios or android
|
||||
default: ios
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Report size of RNTester.app (analysis-bot)
|
||||
shell: bash
|
||||
run: GITHUB_TOKEN=${{ secrets.PUBLIC_ANALYSISBOT_GITHUB_TOKEN }} scripts/circleci/report-bundle-size.sh ${{ inputs.platform }} || true
|
||||
@@ -0,0 +1,17 @@
|
||||
name: run_e2e
|
||||
description: "Run End-to-End Tests"
|
||||
inputs:
|
||||
platform:
|
||||
description: "Platform to run tests on"
|
||||
required: true
|
||||
default: "js"
|
||||
retries:
|
||||
description: "Number of times to retry failed tests"
|
||||
required: true
|
||||
default: "3"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: "Run Tests: ${{ inputs.platform }} End-to-End Tests"
|
||||
run: node ./scripts/e2e/run-ci-e2e-tests.js --${{ inputs.platform }} --retries ${{ inputs.retries }}
|
||||
shell: bash
|
||||
@@ -1,23 +1,9 @@
|
||||
name: Setup gradle
|
||||
description: "Set up your GitHub Actions workflow with a specific version of gradle"
|
||||
inputs:
|
||||
cache-read-only:
|
||||
description: "Whether the Gradle Cache should be in read-only mode so this job won't be allowed to write to it"
|
||||
default: "true"
|
||||
cache-encryption-key:
|
||||
description: "The encryption key needed to store the Gradle Configuration cache"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
gradle-version: wrapper
|
||||
# We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
|
||||
cache-read-only: ${{ (github.ref != 'refs/heads/main' && !contains(github.ref, '-stable')) || inputs.cache-read-only == 'true' }}
|
||||
# Similarly, for those jobs we want to start with a clean cache so it doesn't grow without limits (this is the negation of the previous condition).
|
||||
cache-write-only: ${{ (github.ref == 'refs/heads/main' || contains(github.ref, '-stable')) && inputs.cache-read-only != 'true' }}
|
||||
add-job-summary-as-pr-comment: on-failure
|
||||
# Encryption key for the Gradle Configuration Cache.
|
||||
# See https://docs.gradle.org/8.6/userguide/configuration_cache.html#config_cache:secrets:configuring_encryption_key
|
||||
cache-encryption-key: ${{ inputs.cache-encryption-key }}
|
||||
|
||||
@@ -4,12 +4,16 @@ inputs:
|
||||
node-version:
|
||||
description: 'The node.js version to use'
|
||||
required: false
|
||||
default: '22.14.0'
|
||||
default: '18'
|
||||
cache:
|
||||
description: 'The package manager to use for caching dependencies'
|
||||
required: false
|
||||
default: 'yarn'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v4.0.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: yarn
|
||||
cache: ${{ inputs.cache }}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
name: setup-xcode-build-cache
|
||||
description: Add caching to iOS jobs to speed up builds
|
||||
inputs:
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
flavor:
|
||||
description: The flavor that is going to be built
|
||||
default: Debug
|
||||
use-frameworks:
|
||||
description: Whether we are bulding with DynamicFrameworks or StaticLibraries
|
||||
default: StaticLibraries
|
||||
ruby-version:
|
||||
description: The ruby version we are going to use
|
||||
default: 2.6.10
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: See commands.yml with_xcodebuild_cache
|
||||
shell: bash
|
||||
run: echo "See commands.yml with_xcodebuild_cache"
|
||||
- name: Cache podfile lock
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: packages/rn-tester/Podfile.lock
|
||||
key: v13-podfilelock-${{ github.job }}-NewArch-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
|
||||
- name: Cache cocoapods
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: packages/rn-tester/Pods
|
||||
key: v15-cocoapods-${{ github.job }}-NewArch-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
xcode-version:
|
||||
description: 'The xcode version to use'
|
||||
required: false
|
||||
default: '16.2.0'
|
||||
default: '15.2'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
name: setup_xcode_build_cache
|
||||
description: Add caching to iOS jobs to speed up builds
|
||||
inputs:
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: See commands.yml with_xcodebuild_cache
|
||||
shell: bash
|
||||
run: echo "See commands.yml with_xcodebuild_cache"
|
||||
- name: Prepare Xcodebuild cache
|
||||
shell: bash
|
||||
run: |
|
||||
WEEK=$(date +"%U")
|
||||
YEAR=$(date +"%Y")
|
||||
echo "$WEEK-$YEAR" > /tmp/week_year
|
||||
- name: Cache podfile lock
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: packages/rn-tester/Podfile.lock
|
||||
key: v9-podfilelock-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile') }}-{{ hashfiles('/tmp/week_year') }}-${{ inputs.hermes-version}}
|
||||
- name: Cache cocoapods
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
path: packages/rn-tester/Pods
|
||||
key: v11-cocoapods-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-{{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
|
||||
@@ -1,104 +0,0 @@
|
||||
name: test-ios-helloworld
|
||||
description: Test iOS Hello World
|
||||
inputs:
|
||||
use-frameworks:
|
||||
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
|
||||
default: StaticLibraries
|
||||
ruby-version:
|
||||
description: The version of ruby that must be used
|
||||
default: 2.6.10
|
||||
flavor:
|
||||
description: The flavor of the build. Must be one of "Debug", "Release".
|
||||
default: Debug
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
react-native-version:
|
||||
description: The version of react-native
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Create Hermes folder
|
||||
shell: bash
|
||||
run: mkdir -p "$HERMES_WS_DIR"
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/
|
||||
- name: Print Downloaded hermes
|
||||
shell: bash
|
||||
run: ls -lR "$HERMES_WS_DIR"
|
||||
- name: Run yarn
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/third-party
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }};
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld
|
||||
args=()
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
args+=(--frameworks dynamic)
|
||||
fi
|
||||
|
||||
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
|
||||
# Let's ensure that the tarballs have the right names
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
|
||||
fi
|
||||
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
TARBALL_FILENAME=$(node ../../packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
|
||||
- name: Run Helloworld tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld
|
||||
yarn test
|
||||
|
||||
- name: Build HelloWorld project
|
||||
shell: bash
|
||||
run: |
|
||||
cd private/helloworld
|
||||
|
||||
args=()
|
||||
if [[ ${{ inputs.flavor }} == "Release" ]]; then
|
||||
args+=(--prod)
|
||||
fi
|
||||
yarn build ios "${args[@]}" | cat
|
||||
yarn bundle ios "${args[@]}" | cat
|
||||
@@ -1,173 +0,0 @@
|
||||
name: test-ios-rntester
|
||||
description: Test iOS RNTester
|
||||
inputs:
|
||||
use-frameworks:
|
||||
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
|
||||
default: StaticLibraries
|
||||
ruby-version:
|
||||
description: The version of ruby that must be used
|
||||
default: 2.6.10
|
||||
run-unit-tests:
|
||||
description: whether unit tests should run or not.
|
||||
default: "false"
|
||||
hermes-tarball-artifacts-dir:
|
||||
description: The directory where the hermes tarball artifacts are stored
|
||||
default: /tmp/hermes/hermes-runtime-darwin
|
||||
flavor:
|
||||
description: The flavor of the build. Must be one of "Debug", "Release".
|
||||
default: Debug
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
react-native-version:
|
||||
description: The version of react-native
|
||||
required: true
|
||||
run-e2e-tests:
|
||||
description: Whether we want to run E2E tests or not
|
||||
required: false
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: ${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Prepare IOS Tests
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
uses: ./.github/actions/prepare-ios-tests
|
||||
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
|
||||
- name: Print Hermes version
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
if [[ -e $TARBALL_PATH ]]; then
|
||||
tar -xf $TARBALL_PATH
|
||||
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
|
||||
chmod +x ./destroot/bin/hermes
|
||||
./destroot/bin/hermes test.js
|
||||
rm test.js
|
||||
rm -rf destroot
|
||||
else
|
||||
echo 'No Hermes tarball found.'
|
||||
fi
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/third-party/
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Setup xcode build cache
|
||||
uses: ./.github/actions/setup-xcode-build-cache
|
||||
with:
|
||||
hermes-version: ${{ inputs.hermes-version }}
|
||||
use-frameworks: ${{ inputs.use-frameworks }}
|
||||
flavor: ${{ inputs.flavor }}
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Install CocoaPods dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
export USE_FRAMEWORKS=dynamic
|
||||
fi
|
||||
|
||||
cd packages/rn-tester
|
||||
|
||||
bundle install
|
||||
bundle exec pod install
|
||||
- name: Build RNTester
|
||||
shell: bash
|
||||
run: |
|
||||
xcodebuild \
|
||||
-scheme "RNTester" \
|
||||
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
|
||||
-configuration "${{ inputs.flavor }}" \
|
||||
-sdk "iphonesimulator" \
|
||||
-destination "generic/platform=iOS Simulator" \
|
||||
-derivedDataPath "/tmp/RNTesterBuild"
|
||||
|
||||
echo "Print path to *.app file"
|
||||
APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app")
|
||||
|
||||
echo "App found at $APP_PATH"
|
||||
echo "app-path=$APP_PATH" >> $GITHUB_ENV
|
||||
- name: "Run Tests: iOS Unit and Integration Tests"
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
shell: bash
|
||||
run: yarn test-ios
|
||||
|
||||
- name: Zip Derived data folder
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "zipping tests results"
|
||||
cd /Users/distiller/Library/Developer/Xcode
|
||||
XCRESULT_PATH=$(find . -name '*.xcresult')
|
||||
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
with:
|
||||
name: xcresults
|
||||
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
|
||||
- name: Upload RNTester App
|
||||
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: RNTesterApp-NewArch-${{ inputs.flavor }}
|
||||
path: ${{ env.app-path }}
|
||||
- name: Store test results
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: test-results
|
||||
path: ./reports/junit
|
||||
@@ -1,26 +0,0 @@
|
||||
name: test-js
|
||||
description: Runs all the JS tests in the codebase
|
||||
inputs:
|
||||
node-version:
|
||||
description: "The node.js version to use"
|
||||
required: false
|
||||
default: "22"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
- name: Yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Run Tests - JavaScript Tests
|
||||
shell: bash
|
||||
run: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: test-js-results
|
||||
compression-level: 1
|
||||
path: ./reports/junit
|
||||
@@ -1,52 +0,0 @@
|
||||
name: test-library-on-nightly
|
||||
description: Tests a library on a nightly
|
||||
inputs:
|
||||
library-npm-package:
|
||||
description: The library npm package to add
|
||||
required: true
|
||||
platform:
|
||||
description: whether we want to build for iOS or Android
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Create new app
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp
|
||||
npx @react-native-community/cli init RNApp --skip-install --version nightly
|
||||
- name: Add library
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp/RNApp
|
||||
yarn add ${{ inputs.library-npm-package }}
|
||||
|
||||
# iOS
|
||||
- name: Setup xcode
|
||||
if: ${{ inputs.platform == 'ios' }}
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Build iOS
|
||||
shell: bash
|
||||
if: ${{ inputs.platform == 'ios' }}
|
||||
run: |
|
||||
cd /tmp/RNApp/ios
|
||||
bundle install
|
||||
bundle exec pod install
|
||||
xcodebuild build \
|
||||
-workspace RNApp.xcworkspace \
|
||||
-scheme RNApp \
|
||||
-sdk iphonesimulator
|
||||
|
||||
# Android
|
||||
- name: Setup Java for Android
|
||||
if: ${{ inputs.platform == 'android' }}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Build Android
|
||||
shell: bash
|
||||
if: ${{ inputs.platform == 'android' }}
|
||||
run: |
|
||||
cd /tmp/RNApp/android
|
||||
./gradlew assembleDebug
|
||||
@@ -0,0 +1,110 @@
|
||||
name: test_ios_helloworld
|
||||
description: Test iOS Hello World
|
||||
inputs:
|
||||
jsengine:
|
||||
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
|
||||
type: choice
|
||||
default: Hermes
|
||||
options:
|
||||
- JSC
|
||||
- Hermes
|
||||
use-frameworks:
|
||||
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
|
||||
type: choice
|
||||
default: StaticLibraries
|
||||
options:
|
||||
- StaticLibraries
|
||||
- DynamicFrameworks
|
||||
architecture:
|
||||
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
|
||||
type: choice
|
||||
default: OldArch
|
||||
options:
|
||||
- OldArch
|
||||
- NewArch
|
||||
ruby-version:
|
||||
description: The version of ruby that must be used
|
||||
default: 2.6.10
|
||||
flavor:
|
||||
description: The flavor of the build. Must be one of "Debug", "Release".
|
||||
type: choice
|
||||
default: Debug
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
react-native-version:
|
||||
description: The version of react-native
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Create Hermes folder
|
||||
shell: bash
|
||||
run: mkdir -p "$HERMES_WS_DIR"
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/
|
||||
- name: Print Downloaded hermes
|
||||
shell: bash
|
||||
run: ls -lR "$HERMES_WS_DIR"
|
||||
- name: Run yarn
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1.170.0
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/helloworld
|
||||
args=()
|
||||
|
||||
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
|
||||
args+=(--arch old)
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
args+=(--frameworks dynamic)
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
|
||||
args+=(--jsvm jsc)
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
else
|
||||
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
|
||||
# Let's ensure that the tarballs have the right names
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
|
||||
fi
|
||||
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
HERMES_ENGINE_TARBALL_PATH="$HERMES_PATH" yarn bootstrap ios "${args[@]}" | cat
|
||||
fi
|
||||
- name: Build HelloWorld project
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/helloworld
|
||||
|
||||
args=()
|
||||
if [[ ${{ inputs.flavor }} == "Release" ]]; then
|
||||
args+=(--prod)
|
||||
fi
|
||||
yarn build ios "${args[@]}" | cat
|
||||
yarn bundle ios "${args[@]}" | cat
|
||||
@@ -0,0 +1,152 @@
|
||||
name: test_ios_rntester
|
||||
description: Test iOS RNTester
|
||||
inputs:
|
||||
jsengine:
|
||||
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
|
||||
default: Hermes
|
||||
use-frameworks:
|
||||
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
|
||||
default: StaticLibraries
|
||||
architecture:
|
||||
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
|
||||
default: NewArch
|
||||
ruby-version:
|
||||
description: The version of ruby that must be used
|
||||
default: 2.6.10
|
||||
run-unit-tests:
|
||||
description: whether unit tests should run or not.
|
||||
default: false
|
||||
hermes-tarball-artifacts-dir:
|
||||
description: The directory where the hermes tarball artifacts are stored
|
||||
default: /tmp/hermes/hermes-runtime-darwin
|
||||
flavor:
|
||||
description: The flavor of the build. Must be one of "Debug", "Release".
|
||||
default: Debug
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
react-native-version:
|
||||
description: The version of react-native
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn
|
||||
shell: bash
|
||||
run: yarn install --non-interactive
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: ${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1.170.0
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Prepare IOS Tests
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
uses: ./.github/actions/prepare_ios_tests
|
||||
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
|
||||
- name: Print Hermes version
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
if [[ -e $TARBALL_PATH ]]; then
|
||||
tar -xf $TARBALL_PATH
|
||||
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
|
||||
chmod +x ./destroot/bin/hermes
|
||||
./destroot/bin/hermes test.js
|
||||
rm test.js
|
||||
rm -rf destroot
|
||||
else
|
||||
echo 'No Hermes tarball found.'
|
||||
fi
|
||||
- name: Setup xcode build cache
|
||||
uses: ./.github/actions/setup_xcode_build_cache
|
||||
with:
|
||||
hermes-version: ${{ inputs.hermes-version }}
|
||||
- name: Install CocoaPods dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
|
||||
export USE_HERMES=0
|
||||
else
|
||||
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
export USE_FRAMEWORKS=dynamic
|
||||
fi
|
||||
|
||||
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then
|
||||
export RCT_NEW_ARCH_ENABLED=1
|
||||
fi
|
||||
|
||||
cd packages/rn-tester
|
||||
|
||||
bundle install
|
||||
bundle exec pod install
|
||||
- name: Build RNTester
|
||||
if: ${{ inputs.run-unit-tests != true }}
|
||||
shell: bash
|
||||
run: |
|
||||
xcodebuild build \
|
||||
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
|
||||
-scheme RNTester \
|
||||
-sdk iphonesimulator
|
||||
- name: "Run Tests: iOS Unit and Integration Tests"
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
shell: bash
|
||||
run: yarn test-ios
|
||||
- name: Zip Derived data folder
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "zipping tests results"
|
||||
cd /Users/distiller/Library/Developer/Xcode
|
||||
XCRESULT_PATH=$(find . -name '*.xcresult')
|
||||
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
with:
|
||||
name: xcresults
|
||||
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
|
||||
- name: Report bundle size
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
uses: ./.github/actions/report_bundle_size
|
||||
with:
|
||||
platform: ios
|
||||
- name: Store test results
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: test-results
|
||||
path: ./reports/junit
|
||||
@@ -1,22 +0,0 @@
|
||||
name: yarn-install
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
MAX_ATTEMPTS=2
|
||||
ATTEMPT=0
|
||||
WAIT_TIME=20
|
||||
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
|
||||
yarn install --non-interactive --frozen-lockfile && break
|
||||
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
|
||||
sleep $WAIT_TIME
|
||||
ATTEMPT=$((ATTEMPT + 1))
|
||||
done
|
||||
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
|
||||
echo "All attempts to invoke yarn install failed - Aborting the workflow"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,305 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {
|
||||
_verifyTagExists,
|
||||
_extractChangelog,
|
||||
_computeBody,
|
||||
_createDraftReleaseOnGitHub,
|
||||
} = require('../createDraftRelease');
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const silence = () => {};
|
||||
const mockFetch = jest.fn();
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
}));
|
||||
|
||||
global.fetch = mockFetch;
|
||||
|
||||
describe('Create Draft Release', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
describe('#_verifyTagExists', () => {
|
||||
it('throws if the tag does not exists', async () => {
|
||||
const token = 'token';
|
||||
mockFetch.mockReturnValueOnce(Promise.resolve({status: 404}));
|
||||
|
||||
await expect(_verifyTagExists('0.77.1')).rejects.toThrowError(
|
||||
`Tag v0.77.1 does not exist`,
|
||||
);
|
||||
expect(mockFetch).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#_extractChangelog', () => {
|
||||
it(`extracts changelog from CHANGELOG.md`, async () => {
|
||||
const mockedReturnValue = `# Changelog
|
||||
|
||||
## v0.77.2
|
||||
|
||||
- [PR #1234](https://github.com/facebook/react-native/pull/1234) - Some change
|
||||
- [PR #5678](https://github.com/facebook/react-native/pull/5678) - Some other change
|
||||
|
||||
|
||||
## v0.77.1
|
||||
### Breaking Changes
|
||||
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
|
||||
|
||||
#### Android
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
- [PR #3457](https://github.com/facebook/react-native/pull/3457) - Some other change
|
||||
|
||||
#### iOS
|
||||
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change
|
||||
|
||||
### Fixed
|
||||
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
|
||||
|
||||
#### Android
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
|
||||
#### iOS
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change
|
||||
|
||||
|
||||
## v0.77.0
|
||||
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
|
||||
## v0.76.0
|
||||
|
||||
- [PR #7890](https://github.com/facebook/react-native/pull/7890) - Some other change`;
|
||||
|
||||
jest.spyOn(fs, 'readFileSync').mockImplementationOnce(func => {
|
||||
return mockedReturnValue;
|
||||
});
|
||||
const changelog = _extractChangelog('0.77.1');
|
||||
expect(changelog).toEqual(`## v0.77.1
|
||||
### Breaking Changes
|
||||
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
|
||||
|
||||
#### Android
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
- [PR #3457](https://github.com/facebook/react-native/pull/3457) - Some other change
|
||||
|
||||
#### iOS
|
||||
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change
|
||||
|
||||
### Fixed
|
||||
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
|
||||
|
||||
#### Android
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
|
||||
#### iOS
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`);
|
||||
});
|
||||
|
||||
it('does not extract changelog for rc.0', async () => {
|
||||
const changelog = _extractChangelog('0.77.0-rc.0');
|
||||
expect(changelog).toEqual('');
|
||||
});
|
||||
|
||||
it('does not extract changelog for 0.X.0', async () => {
|
||||
const changelog = _extractChangelog('0.77.0');
|
||||
expect(changelog).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#_computeBody', () => {
|
||||
it('computes body for release', async () => {
|
||||
const version = '0.77.1';
|
||||
const changelog = `## v${version}
|
||||
### Breaking Changes
|
||||
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
|
||||
|
||||
#### Android
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
- [PR #3457](https://github.com/facebook/react-native/pull/3457) - Some other change
|
||||
|
||||
#### iOS
|
||||
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
|
||||
const body = _computeBody(version, changelog);
|
||||
|
||||
expect(body).toEqual(`${changelog}
|
||||
|
||||
---
|
||||
|
||||
Hermes dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
ReactNativeDependencies dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
|
||||
|
||||
---
|
||||
|
||||
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
|
||||
|
||||
---
|
||||
|
||||
To help you upgrade to this version, you can use the [Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) ⚛️.
|
||||
|
||||
---
|
||||
|
||||
View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/react-native/blob/main/CHANGELOG.md).`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#_createDraftReleaseOnGitHub', () => {
|
||||
it('creates a draft release on GitHub', async () => {
|
||||
const version = '0.77.1';
|
||||
const url = 'https://api.github.com/repos/facebook/react-native/releases';
|
||||
const token = 'token';
|
||||
const headers = {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
const body = `Draft release body`;
|
||||
const latest = true;
|
||||
const fetchBody = JSON.stringify({
|
||||
tag_name: `v${version}`,
|
||||
name: `${version}`,
|
||||
body: body,
|
||||
draft: true,
|
||||
prerelease: false,
|
||||
make_latest: `${latest}`,
|
||||
});
|
||||
|
||||
mockFetch.mockReturnValueOnce(
|
||||
Promise.resolve({
|
||||
status: 201,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
}),
|
||||
}),
|
||||
);
|
||||
const response = await _createDraftReleaseOnGitHub(
|
||||
version,
|
||||
body,
|
||||
latest,
|
||||
token,
|
||||
);
|
||||
expect(mockFetch).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
`https://api.github.com/repos/facebook/react-native/releases`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
expect(response).toEqual(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
});
|
||||
|
||||
it('creates a draft release for prerelease on GitHub', async () => {
|
||||
const version = '0.77.0-rc.2';
|
||||
const url = 'https://api.github.com/repos/facebook/react-native/releases';
|
||||
const token = 'token';
|
||||
const headers = {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
const body = `Draft release body`;
|
||||
const latest = true;
|
||||
const fetchBody = JSON.stringify({
|
||||
tag_name: `v${version}`,
|
||||
name: `${version}`,
|
||||
body: body,
|
||||
draft: true,
|
||||
prerelease: true,
|
||||
make_latest: `${latest}`,
|
||||
});
|
||||
|
||||
mockFetch.mockReturnValueOnce(
|
||||
Promise.resolve({
|
||||
status: 201,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
}),
|
||||
}),
|
||||
);
|
||||
const response = await _createDraftReleaseOnGitHub(
|
||||
version,
|
||||
body,
|
||||
latest,
|
||||
token,
|
||||
);
|
||||
expect(mockFetch).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
`https://api.github.com/repos/facebook/react-native/releases`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
expect(response).toEqual(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
});
|
||||
|
||||
it('throws if the post failes', async () => {
|
||||
const version = '0.77.0-rc.2';
|
||||
const url = 'https://api.github.com/repos/facebook/react-native/releases';
|
||||
const token = 'token';
|
||||
const headers = {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
const body = `Draft release body`;
|
||||
const latest = true;
|
||||
const fetchBody = JSON.stringify({
|
||||
tag_name: `v${version}`,
|
||||
name: `${version}`,
|
||||
body: body,
|
||||
draft: true,
|
||||
prerelease: true,
|
||||
make_latest: `${latest}`,
|
||||
});
|
||||
|
||||
mockFetch.mockReturnValueOnce(
|
||||
Promise.resolve({
|
||||
status: 401,
|
||||
}),
|
||||
);
|
||||
await expect(
|
||||
_createDraftReleaseOnGitHub(version, body, latest, token),
|
||||
).rejects.toThrowError();
|
||||
expect(mockFetch).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
`https://api.github.com/repos/facebook/react-native/releases`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,83 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {extractIssueOncalls} = require('../extractIssueOncalls');
|
||||
|
||||
const userMap = {
|
||||
'@g': '1785',
|
||||
'@c': '1781',
|
||||
'@s': '1272',
|
||||
'@d': '1332',
|
||||
'@m': '9555',
|
||||
'@p': '6097',
|
||||
'@f': '7565',
|
||||
};
|
||||
|
||||
const schedule = {
|
||||
'2025-04-01': ['@m', '@f'],
|
||||
'2025-04-08': ['@g', '@d'],
|
||||
};
|
||||
|
||||
describe('extractIssueOncalls', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.useFakeTimers('modern');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
it('extracts m and f on 6 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 6));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@m'], userMap['@f']]);
|
||||
});
|
||||
|
||||
it('extracts m and f on 7 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 7));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@m'], userMap['@f']]);
|
||||
});
|
||||
|
||||
it('extracts g and d on 8 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 8));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
|
||||
});
|
||||
|
||||
it('extracts g and d on 9 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 9));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
|
||||
});
|
||||
|
||||
it('extracts g and d on 10 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 10));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
|
||||
});
|
||||
|
||||
it('extracts g and d on 11 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 11));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
|
||||
});
|
||||
|
||||
it('extracts g and d on 12 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 12));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
|
||||
});
|
||||
|
||||
it('extracts g and d on 13 of April', () => {
|
||||
jest.setSystemTime(new Date(2025, 3, 13));
|
||||
const oncalls = extractIssueOncalls(schedule, userMap);
|
||||
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
|
||||
});
|
||||
});
|
||||
@@ -1,251 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {
|
||||
generateChangelog,
|
||||
_computePreviousVersionFrom,
|
||||
_generateChangelog,
|
||||
_pushCommit,
|
||||
_createPR,
|
||||
} = require('../generateChangelog');
|
||||
|
||||
const silence = () => {};
|
||||
const mockGetNpmPackageInfo = jest.fn();
|
||||
const mockExecSync = jest.fn();
|
||||
const mockRun = jest.fn();
|
||||
const mockFetch = jest.fn();
|
||||
const mockExit = jest.fn();
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
run: mockRun,
|
||||
getNpmPackageInfo: mockGetNpmPackageInfo,
|
||||
}));
|
||||
|
||||
process.exit = mockExit;
|
||||
global.fetch = mockFetch;
|
||||
|
||||
describe('Generate Changelog', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
describe('_computePreviousVersionFrom', () => {
|
||||
it('returns rc.0 when rc is 1', async () => {
|
||||
const currentVersion = '0.78.0-rc.1';
|
||||
const expectedVersion = '0.78.0-rc.0';
|
||||
|
||||
const receivedVersion = await _computePreviousVersionFrom(currentVersion);
|
||||
|
||||
expect(receivedVersion).toEqual(expectedVersion);
|
||||
});
|
||||
|
||||
it('returns previous rc version when rc is > 1', async () => {
|
||||
const currentVersion = '0.78.0-rc.5';
|
||||
const expectedVersion = '0.78.0-rc.4';
|
||||
|
||||
const receivedVersion = await _computePreviousVersionFrom(currentVersion);
|
||||
|
||||
expect(receivedVersion).toEqual(expectedVersion);
|
||||
});
|
||||
|
||||
it('returns previous patch version when rc is 0', async () => {
|
||||
const currentVersion = '0.78.0-rc.0';
|
||||
const expectedVersion = '0.77.1';
|
||||
|
||||
mockGetNpmPackageInfo.mockReturnValueOnce(
|
||||
Promise.resolve({version: '0.77.1'}),
|
||||
);
|
||||
|
||||
const receivedVersion = await _computePreviousVersionFrom(currentVersion);
|
||||
|
||||
expect(receivedVersion).toEqual(expectedVersion);
|
||||
});
|
||||
|
||||
it('returns patch 0 when patch is 1', async () => {
|
||||
const currentVersion = '0.78.1';
|
||||
const expectedVersion = '0.78.0';
|
||||
|
||||
const receivedVersion = await _computePreviousVersionFrom(currentVersion);
|
||||
|
||||
expect(receivedVersion).toEqual(expectedVersion);
|
||||
});
|
||||
|
||||
it('returns previous patch when patch is > 1', async () => {
|
||||
const currentVersion = '0.78.5';
|
||||
const expectedVersion = '0.78.4';
|
||||
|
||||
const receivedVersion = await _computePreviousVersionFrom(currentVersion);
|
||||
|
||||
expect(receivedVersion).toEqual(expectedVersion);
|
||||
});
|
||||
|
||||
it('returns null when patch is 0', async () => {
|
||||
const currentVersion = '0.78.0';
|
||||
|
||||
const receivedVersion = await _computePreviousVersionFrom(currentVersion);
|
||||
|
||||
expect(receivedVersion).toBeNull();
|
||||
});
|
||||
|
||||
it("throws an error when the version can't be parsed", async () => {
|
||||
const currentVersion = '0.78.0-rc0';
|
||||
|
||||
await expect(
|
||||
_computePreviousVersionFrom(currentVersion),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('_generateChangelog', () => {
|
||||
it('calls git in the right order', async () => {
|
||||
const currentVersion = '0.79.0-rc5';
|
||||
const previousVersion = '0.79.0-rc4';
|
||||
const token = 'token';
|
||||
|
||||
expectedCommandArgs = [
|
||||
'@rnx-kit/rn-changelog-generator',
|
||||
'--base',
|
||||
`v${previousVersion}`,
|
||||
'--compare',
|
||||
`v${currentVersion}`,
|
||||
'--repo',
|
||||
'.',
|
||||
'--changelog',
|
||||
'./CHANGELOG.md',
|
||||
'--token',
|
||||
`${token}`,
|
||||
];
|
||||
|
||||
_generateChangelog(previousVersion, currentVersion, token);
|
||||
|
||||
expect(mockRun).toHaveBeenCalledTimes(4);
|
||||
expect(mockRun).toHaveBeenNthCalledWith(1, 'git checkout main');
|
||||
expect(mockRun).toHaveBeenNthCalledWith(2, 'git fetch');
|
||||
expect(mockRun).toHaveBeenNthCalledWith(3, 'git pull origin main');
|
||||
expect(mockRun).toHaveBeenNthCalledWith(
|
||||
4,
|
||||
`npx ${expectedCommandArgs.join(' ')}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('_pushCommit', () => {
|
||||
it('calls git in the right order', async () => {
|
||||
const currentVersion = '0.79.0-rc5';
|
||||
|
||||
_pushCommit(currentVersion);
|
||||
|
||||
expect(mockRun).toHaveBeenCalledTimes(4);
|
||||
expect(mockRun).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
`git checkout -b changelog/v${currentVersion}`,
|
||||
);
|
||||
expect(mockRun).toHaveBeenNthCalledWith(2, 'git add CHANGELOG.md');
|
||||
expect(mockRun).toHaveBeenNthCalledWith(
|
||||
3,
|
||||
`git commit -m "[RN][Changelog] Add changelog for v${currentVersion}"`,
|
||||
);
|
||||
expect(mockRun).toHaveBeenNthCalledWith(
|
||||
4,
|
||||
`git push origin changelog/v${currentVersion}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('_createPR', () => {
|
||||
it('throws error when status is not 201', async () => {
|
||||
const currentVersion = '0.79.0-rc5';
|
||||
const token = 'token';
|
||||
|
||||
mockFetch.mockReturnValueOnce(Promise.resolve({status: 401}));
|
||||
|
||||
const headers = {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
|
||||
const content = `
|
||||
## Summary
|
||||
Add Changelog for ${currentVersion}
|
||||
|
||||
## Changelog:
|
||||
[Internal] - Add Changelog for ${currentVersion}
|
||||
|
||||
## Test Plan:
|
||||
N/A`;
|
||||
|
||||
const body = {
|
||||
title: `[RN][Changelog] Add changelog for v${currentVersion}`,
|
||||
head: `changelog/v${currentVersion}`,
|
||||
base: 'main',
|
||||
body: content,
|
||||
};
|
||||
|
||||
await expect(_createPR(currentVersion, token)).rejects.toThrow();
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://api.github.com/repos/facebook/react-native/pulls',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: JSON.stringify(body),
|
||||
},
|
||||
);
|
||||
});
|
||||
it('Returns the pr url', async () => {
|
||||
const currentVersion = '0.79.0-rc5';
|
||||
const token = 'token';
|
||||
const expectedPrURL =
|
||||
'https://github.com/facebook/react-native/pulls/1234';
|
||||
|
||||
const returnedObject = {
|
||||
status: 201,
|
||||
json: () => Promise.resolve({html_url: expectedPrURL}),
|
||||
};
|
||||
mockFetch.mockReturnValueOnce(Promise.resolve(returnedObject));
|
||||
|
||||
const headers = {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
|
||||
const content = `
|
||||
## Summary
|
||||
Add Changelog for ${currentVersion}
|
||||
|
||||
## Changelog:
|
||||
[Internal] - Add Changelog for ${currentVersion}
|
||||
|
||||
## Test Plan:
|
||||
N/A`;
|
||||
|
||||
const body = {
|
||||
title: `[RN][Changelog] Add changelog for v${currentVersion}`,
|
||||
head: `changelog/v${currentVersion}`,
|
||||
base: 'main',
|
||||
body: content,
|
||||
};
|
||||
|
||||
const receivedPrURL = await _createPR(currentVersion, token);
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://api.github.com/repos/facebook/react-native/pulls',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: JSON.stringify(body),
|
||||
},
|
||||
);
|
||||
expect(receivedPrURL).toEqual(expectedPrURL);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,189 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
prepareFailurePayload,
|
||||
sendMessageToDiscord,
|
||||
} = require('../notifyDiscord');
|
||||
|
||||
describe('prepareFailurePayload', () => {
|
||||
it('should handle undefined failures', () => {
|
||||
const message = prepareFailurePayload(undefined);
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle empty failures array', () => {
|
||||
const message = prepareFailurePayload([]);
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
|
||||
});
|
||||
});
|
||||
|
||||
it('should format a single failure correctly', () => {
|
||||
const failures = [
|
||||
{
|
||||
library: 'react-native-reanimated',
|
||||
platform: 'iOS',
|
||||
},
|
||||
];
|
||||
|
||||
const message = prepareFailurePayload(failures);
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [iOS] react-native-reanimated',
|
||||
});
|
||||
});
|
||||
|
||||
it('should sort multiple failures by platform and library name', () => {
|
||||
const failures = [
|
||||
{
|
||||
library: 'react-native-reanimated',
|
||||
platform: 'iOS',
|
||||
},
|
||||
{
|
||||
library: 'react-native-gesture-handler',
|
||||
platform: 'Android',
|
||||
},
|
||||
{
|
||||
library: 'react-native-screens',
|
||||
platform: 'iOS',
|
||||
},
|
||||
{
|
||||
library: 'react-native-svg',
|
||||
platform: 'Android',
|
||||
},
|
||||
];
|
||||
|
||||
const message = prepareFailurePayload(failures);
|
||||
|
||||
// The failures should be sorted: first Android (alphabetically), then iOS
|
||||
// Within each platform, libraries should be sorted alphabetically
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [Android] react-native-gesture-handler\n❌ [Android] react-native-svg\n❌ [iOS] react-native-reanimated\n❌ [iOS] react-native-screens',
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle failures with missing properties', () => {
|
||||
const failures = [
|
||||
{
|
||||
// Missing library
|
||||
platform: 'iOS',
|
||||
},
|
||||
{
|
||||
library: 'react-native-gesture-handler',
|
||||
// Missing platform
|
||||
},
|
||||
{
|
||||
// Both missing
|
||||
},
|
||||
];
|
||||
|
||||
const message = prepareFailurePayload(failures);
|
||||
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [iOS] Unknown\n❌ [Unknown] react-native-gesture-handler\n❌ [Unknown] Unknown',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('sendMessageToDiscord', () => {
|
||||
// Store the original fetch function
|
||||
const originalFetch = global.fetch;
|
||||
|
||||
// Setup and teardown for each test
|
||||
beforeEach(() => {
|
||||
// Mock the global fetch function
|
||||
global.fetch = jest.fn();
|
||||
// Silence console logs during tests
|
||||
jest.spyOn(console, 'log').mockImplementation(() => {});
|
||||
jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// Restore the original fetch function
|
||||
global.fetch = originalFetch;
|
||||
// Restore console functions
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should throw an error if webhook URL is missing', async () => {
|
||||
await expect(sendMessageToDiscord(null, {})).rejects.toThrow(
|
||||
'Discord webhook URL is missing',
|
||||
);
|
||||
});
|
||||
|
||||
it('should send a message successfully', async () => {
|
||||
// Mock a successful response
|
||||
global.fetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
status: 200,
|
||||
});
|
||||
|
||||
const webhook = 'https://discord.com/api/webhooks/123/abc';
|
||||
const message = {content: 'Test message'};
|
||||
|
||||
await expect(sendMessageToDiscord(webhook, message)).resolves.not.toThrow();
|
||||
|
||||
// Verify fetch was called with the right arguments
|
||||
expect(global.fetch).toHaveBeenCalledWith(webhook, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(message),
|
||||
});
|
||||
|
||||
// Verify console.log was called
|
||||
expect(console.log).toHaveBeenCalledWith(
|
||||
'Successfully sent message to Discord',
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw an error if the response is not ok', async () => {
|
||||
// Mock a failed response
|
||||
global.fetch.mockResolvedValueOnce({
|
||||
ok: false,
|
||||
status: 400,
|
||||
text: jest.fn().mockResolvedValueOnce('Bad Request'),
|
||||
});
|
||||
|
||||
const webhook = 'https://discord.com/api/webhooks/123/abc';
|
||||
const message = {content: 'Test message'};
|
||||
|
||||
await expect(sendMessageToDiscord(webhook, message)).rejects.toThrow(
|
||||
'HTTP status code: 400',
|
||||
);
|
||||
|
||||
// Verify console.error was called
|
||||
expect(console.error).toHaveBeenCalledWith(
|
||||
'Failed to send message to Discord: 400 Bad Request',
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw an error if fetch fails', async () => {
|
||||
// Mock a network error
|
||||
const networkError = new Error('Network error');
|
||||
global.fetch.mockRejectedValueOnce(networkError);
|
||||
|
||||
const webhook = 'https://discord.com/api/webhooks/123/abc';
|
||||
const message = {content: 'Test message'};
|
||||
|
||||
await expect(sendMessageToDiscord(webhook, message)).rejects.toThrow(
|
||||
'Network error',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,129 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {
|
||||
publishTemplate,
|
||||
verifyPublishedTemplate,
|
||||
} = require('../publishTemplate');
|
||||
|
||||
const mockRun = jest.fn();
|
||||
const mockSleep = jest.fn();
|
||||
const mockGetNpmPackageInfo = jest.fn();
|
||||
const mockVerifyPublishedPackage = jest.fn();
|
||||
const silence = () => {};
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
run: mockRun,
|
||||
sleep: mockSleep,
|
||||
getNpmPackageInfo: mockGetNpmPackageInfo,
|
||||
}));
|
||||
|
||||
jest.mock('../verifyPublishedPackage.js', () => ({
|
||||
verifyPublishedPackage: mockVerifyPublishedPackage,
|
||||
}));
|
||||
|
||||
const getMockGithub = () => ({
|
||||
rest: {
|
||||
actions: {
|
||||
createWorkflowDispatch: jest.fn(),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
describe('#publishTemplate', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
it('checks commits for magic #publish-package-to-npm&latest string and sets latest', async () => {
|
||||
mockRun.mockReturnValueOnce(`
|
||||
The commit message
|
||||
|
||||
#publish-packages-to-npm&latest`);
|
||||
|
||||
const github = getMockGithub();
|
||||
await publishTemplate(github, '0.76.0', true);
|
||||
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
|
||||
owner: 'react-native-community',
|
||||
repo: 'template',
|
||||
workflow_id: 'release.yaml',
|
||||
ref: '0.76-stable',
|
||||
inputs: {
|
||||
dry_run: true,
|
||||
is_latest_on_npm: true,
|
||||
version: '0.76.0',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('pubished as is_latest_on_npm = false if missing magic string', async () => {
|
||||
mockRun.mockReturnValueOnce(`
|
||||
The commit message without magic
|
||||
`);
|
||||
|
||||
const github = getMockGithub();
|
||||
await publishTemplate(github, '0.76.0', false);
|
||||
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
|
||||
owner: 'react-native-community',
|
||||
repo: 'template',
|
||||
workflow_id: 'release.yaml',
|
||||
ref: '0.76-stable',
|
||||
inputs: {
|
||||
dry_run: false,
|
||||
is_latest_on_npm: false,
|
||||
version: '0.76.0',
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#verifyPublishedTemplate', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
it("waits on npm updating for version and not 'latest'", async () => {
|
||||
const NOT_LATEST = false;
|
||||
const version = '0.77.0';
|
||||
|
||||
await verifyPublishedTemplate(version, NOT_LATEST);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'@react-native-community/template',
|
||||
version,
|
||||
null,
|
||||
18,
|
||||
);
|
||||
});
|
||||
|
||||
it('waits on npm updating version and latest tag', async () => {
|
||||
const IS_LATEST = true;
|
||||
const version = '0.77.0';
|
||||
|
||||
await verifyPublishedTemplate(version, IS_LATEST);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'@react-native-community/template',
|
||||
version,
|
||||
'latest',
|
||||
18,
|
||||
);
|
||||
});
|
||||
|
||||
describe('retries', () => {
|
||||
it('will timeout if npm does not update package version after a set number of retries', async () => {
|
||||
const RETRIES = 2;
|
||||
|
||||
await verifyPublishedTemplate('0.77.0', true, RETRIES),
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'@react-native-community/template',
|
||||
'0.77.0',
|
||||
'latest',
|
||||
2,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,87 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {verifyArtifactsAreOnMaven} = require('../verifyArtifactsAreOnMaven');
|
||||
|
||||
const mockSleep = jest.fn();
|
||||
const silence = () => {};
|
||||
const mockFetch = jest.fn();
|
||||
const mockExit = jest.fn();
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
sleep: mockSleep,
|
||||
}));
|
||||
|
||||
process.exit = mockExit;
|
||||
global.fetch = mockFetch;
|
||||
|
||||
describe('#verifyArtifactsAreOnMaven', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
it('waits for the packages to be published on maven when version has no v', async () => {
|
||||
mockSleep.mockReturnValueOnce(Promise.resolve()).mockImplementation(() => {
|
||||
throw new Error('Should not be called again!');
|
||||
});
|
||||
mockFetch
|
||||
.mockReturnValueOnce(Promise.resolve({status: 404}))
|
||||
.mockReturnValueOnce(Promise.resolve({status: 200}));
|
||||
|
||||
const version = '0.78.1';
|
||||
await verifyArtifactsAreOnMaven(version);
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
|
||||
it('waits for the packages to be published on maven, when version starts with v', async () => {
|
||||
mockSleep.mockReturnValueOnce(Promise.resolve()).mockImplementation(() => {
|
||||
throw new Error('Should not be called again!');
|
||||
});
|
||||
mockFetch
|
||||
.mockReturnValueOnce(Promise.resolve({status: 404}))
|
||||
.mockReturnValueOnce(Promise.resolve({status: 200}));
|
||||
|
||||
const version = 'v0.78.1';
|
||||
await verifyArtifactsAreOnMaven(version);
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
|
||||
it('passes immediately if packages are already on Maven', async () => {
|
||||
mockFetch.mockReturnValueOnce(Promise.resolve({status: 200}));
|
||||
|
||||
const version = '0.78.1';
|
||||
await verifyArtifactsAreOnMaven(version);
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(0);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
|
||||
it('tries 90 times and then exits', async () => {
|
||||
mockSleep.mockReturnValue(Promise.resolve());
|
||||
mockFetch.mockReturnValue(Promise.resolve({status: 404}));
|
||||
|
||||
const version = '0.78.1';
|
||||
await verifyArtifactsAreOnMaven(version);
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(90);
|
||||
expect(mockExit).toHaveBeenCalledWith(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,135 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {verifyPublishedPackage} = require('../verifyPublishedPackage');
|
||||
|
||||
const mockRun = jest.fn();
|
||||
const mockSleep = jest.fn();
|
||||
const mockGetNpmPackageInfo = jest.fn();
|
||||
const silence = () => {};
|
||||
|
||||
const REACT_NATIVE_PACKAGE = 'react-native';
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
run: mockRun,
|
||||
sleep: mockSleep,
|
||||
getNpmPackageInfo: mockGetNpmPackageInfo,
|
||||
}));
|
||||
|
||||
describe('#verifyPublishedPackage', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
it("waits on npm updating for version and not 'latest'", async () => {
|
||||
mockGetNpmPackageInfo
|
||||
// template@<version>
|
||||
.mockReturnValueOnce(Promise.reject('mock http/404'))
|
||||
.mockReturnValueOnce(Promise.resolve());
|
||||
mockSleep.mockReturnValueOnce(Promise.resolve()).mockImplementation(() => {
|
||||
throw new Error('Should not be called again!');
|
||||
});
|
||||
|
||||
const version = '0.78.0';
|
||||
await verifyPublishedPackage(REACT_NATIVE_PACKAGE, version, null);
|
||||
|
||||
expect(mockGetNpmPackageInfo).toHaveBeenLastCalledWith(
|
||||
REACT_NATIVE_PACKAGE,
|
||||
version,
|
||||
);
|
||||
});
|
||||
|
||||
it('waits on npm updating version and latest tag', async () => {
|
||||
const version = '0.78.0';
|
||||
mockGetNpmPackageInfo
|
||||
// template@latest → unknown tag
|
||||
.mockReturnValueOnce(Promise.reject('mock http/404'))
|
||||
// template@latest != version → old tag
|
||||
.mockReturnValueOnce(Promise.resolve({version: '0.76.5'}))
|
||||
// template@latest == version → correct tag
|
||||
.mockReturnValueOnce(Promise.resolve({version}));
|
||||
mockSleep
|
||||
.mockReturnValueOnce(Promise.resolve())
|
||||
.mockReturnValueOnce(Promise.resolve())
|
||||
.mockImplementation(() => {
|
||||
throw new Error('Should not be called again!');
|
||||
});
|
||||
|
||||
await verifyPublishedPackage(REACT_NATIVE_PACKAGE, version, 'latest');
|
||||
|
||||
expect(mockGetNpmPackageInfo).toHaveBeenCalledWith(
|
||||
REACT_NATIVE_PACKAGE,
|
||||
'latest',
|
||||
);
|
||||
});
|
||||
|
||||
it('waits on npm updating version and next tag', async () => {
|
||||
const version = '0.78.0-rc.0';
|
||||
mockGetNpmPackageInfo
|
||||
// template@latest → unknown tag
|
||||
.mockReturnValueOnce(Promise.reject('mock http/404'))
|
||||
// template@latest != version → old tag
|
||||
.mockReturnValueOnce(Promise.resolve({version: '0.76.5'}))
|
||||
// template@latest == version → correct tag
|
||||
.mockReturnValueOnce(Promise.resolve({version}));
|
||||
mockSleep
|
||||
.mockReturnValueOnce(Promise.resolve())
|
||||
.mockReturnValueOnce(Promise.resolve())
|
||||
.mockImplementation(() => {
|
||||
throw new Error('Should not be called again!');
|
||||
});
|
||||
await verifyPublishedPackage(REACT_NATIVE_PACKAGE, version, 'next');
|
||||
|
||||
expect(mockGetNpmPackageInfo).toHaveBeenCalledWith(
|
||||
REACT_NATIVE_PACKAGE,
|
||||
'next',
|
||||
);
|
||||
});
|
||||
|
||||
describe('timeouts', () => {
|
||||
let mockProcess;
|
||||
beforeEach(() => {
|
||||
mockProcess = jest.spyOn(process, 'exit').mockImplementation(code => {
|
||||
throw new Error(`process.exit(${code}) called!`);
|
||||
});
|
||||
});
|
||||
afterEach(() => mockProcess.mockRestore());
|
||||
it('will timeout if npm does not update package version after a set number of retries', async () => {
|
||||
const RETRIES = 2;
|
||||
mockGetNpmPackageInfo.mockReturnValue(Promise.reject('mock http/404'));
|
||||
mockSleep.mockReturnValue(Promise.resolve());
|
||||
await expect(() =>
|
||||
verifyPublishedPackage(
|
||||
REACT_NATIVE_PACKAGE,
|
||||
'0.77.0',
|
||||
'latest',
|
||||
RETRIES,
|
||||
),
|
||||
).rejects.toThrowError('process.exit(1) called!');
|
||||
expect(mockGetNpmPackageInfo).toHaveBeenCalledTimes(RETRIES);
|
||||
});
|
||||
|
||||
it('will timeout if npm does not update latest tag after a set number of retries', async () => {
|
||||
const RETRIES = 7;
|
||||
const IS_LATEST = true;
|
||||
mockGetNpmPackageInfo.mockReturnValue(
|
||||
Promise.resolve({version: '0.76.5'}),
|
||||
);
|
||||
mockSleep.mockReturnValue(Promise.resolve());
|
||||
await expect(async () => {
|
||||
await verifyPublishedPackage(
|
||||
REACT_NATIVE_PACKAGE,
|
||||
'0.77.0',
|
||||
'latest',
|
||||
RETRIES,
|
||||
);
|
||||
}).rejects.toThrowError('process.exit(1) called!');
|
||||
expect(mockGetNpmPackageInfo).toHaveBeenCalledTimes(RETRIES);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,109 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {verifyReleaseOnNpm} = require('../verifyReleaseOnNpm');
|
||||
|
||||
const mockVerifyPublishedPackage = jest.fn();
|
||||
const silence = () => {};
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
sleep: silence,
|
||||
}));
|
||||
|
||||
jest.mock('../verifyPublishedPackage.js', () => ({
|
||||
verifyPublishedPackage: mockVerifyPublishedPackage,
|
||||
}));
|
||||
|
||||
describe('#verifyReleaseOnNPM', () => {
|
||||
beforeEach(jest.clearAllMocks);
|
||||
|
||||
it("waits on npm updating for version and not 'latest'", async () => {
|
||||
const NOT_LATEST = false;
|
||||
const version = '0.78.0';
|
||||
await verifyReleaseOnNpm(version, NOT_LATEST);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenLastCalledWith(
|
||||
'react-native',
|
||||
version,
|
||||
null,
|
||||
18,
|
||||
);
|
||||
});
|
||||
|
||||
it('waits on npm updating version and latest tag', async () => {
|
||||
const IS_LATEST = true;
|
||||
const version = '0.78.0';
|
||||
|
||||
await verifyReleaseOnNpm(version, IS_LATEST);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'react-native',
|
||||
version,
|
||||
'latest',
|
||||
18,
|
||||
);
|
||||
});
|
||||
|
||||
it('waits on npm updating version, not latest and next tag', async () => {
|
||||
const IS_LATEST = false;
|
||||
const version = '0.78.0-rc.0';
|
||||
|
||||
await verifyReleaseOnNpm(version, IS_LATEST);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'react-native',
|
||||
version,
|
||||
'next',
|
||||
18,
|
||||
);
|
||||
});
|
||||
|
||||
it('waits on npm updating version, latest and next tag', async () => {
|
||||
const IS_LATEST = true;
|
||||
const version = '0.78.0-rc.0';
|
||||
|
||||
await verifyReleaseOnNpm(version, IS_LATEST);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'react-native',
|
||||
version,
|
||||
'next',
|
||||
18,
|
||||
);
|
||||
});
|
||||
|
||||
describe('timeouts', () => {
|
||||
it('will timeout if npm does not update package version after a set number of retries', async () => {
|
||||
const RETRIES = 2;
|
||||
|
||||
await verifyReleaseOnNpm('0.77.0', true, RETRIES),
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'react-native',
|
||||
'0.77.0',
|
||||
'latest',
|
||||
2,
|
||||
);
|
||||
});
|
||||
|
||||
it('will timeout if npm does not update latest tag after a set number of retries', async () => {
|
||||
const RETRIES = 7;
|
||||
const IS_LATEST = true;
|
||||
|
||||
await verifyReleaseOnNpm('0.77.0', IS_LATEST, RETRIES);
|
||||
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'react-native',
|
||||
'0.77.0',
|
||||
'latest',
|
||||
7,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -48,78 +48,96 @@ module.exports = async (github, context, labelWithContext) => {
|
||||
switch (labelWithContext.label) {
|
||||
case 'Type: Invalid':
|
||||
await addComment(
|
||||
`> [!CAUTION]\n` +
|
||||
`> **Invalid issue**: This issue is not valid, either is not a bug in React Native, it doesn't match any of the issue template, or we can't help further with this.`,
|
||||
`| :warning: | Issue is Invalid |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Question':
|
||||
await addComment(
|
||||
`> [!NOTE]\n` +
|
||||
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Resolution: For Stack Overflow':
|
||||
await addComment(
|
||||
`> [!NOTE]\n` +
|
||||
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
|
||||
`| :warning: | Issue is a Question |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/). |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Docs':
|
||||
await addComment(
|
||||
`> [!NOTE]\n` +
|
||||
`> **Docs issue**: This issue looks like an issue related to our docs. Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository.`,
|
||||
`| :warning: | Documentation Issue |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Resolution: For Stack Overflow':
|
||||
await addComment(
|
||||
`| :warning: | Issue is a Question |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Expo':
|
||||
await addComment(
|
||||
`> [!NOTE]\n` +
|
||||
`> **Expo related**: It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.`,
|
||||
`| :warning: | Issue is Related to Expo |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Needs: Issue Template':
|
||||
await addComment(
|
||||
`> [!WARNING]\n` +
|
||||
`> **Missing issue template**: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A&projects=&template=bug_report.yml). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.`,
|
||||
`| :warning: | Missing Required Fields |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Needs: Environment Info':
|
||||
await addComment(
|
||||
`> [!WARNING]\n` +
|
||||
`> **Missing info**: It looks like your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console.`,
|
||||
`| :warning: | Missing Environment Information |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Newer Patch Available':
|
||||
await addComment(
|
||||
`| :warning: | Newer Version of React Native is Available! |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |`,
|
||||
);
|
||||
return;
|
||||
case 'Needs: Version Info':
|
||||
await addComment(
|
||||
`> [!WARNING]\n` +
|
||||
`> **Could not parse version**: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.`,
|
||||
`| :warning: | Add or Reformat Version Info |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2 |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Needs: Repro':
|
||||
await addComment(
|
||||
`> [!WARNING]\n` +
|
||||
`> **Missing reproducer**: We could not detect a reproducible example in your issue report. Reproducers are **mandatory** and we can accept only one of those as a valid reproducer: <br/><ul><li>For majority of bugs: send us a Pull Request with the [RNTesterPlayground.js](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Playground/RNTesterPlayground.js) edited to reproduce your bug.</li><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/upgrade related: a project using our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul><br/>You can read more about about it on our website: [How to report a bug](https://reactnative.dev/contributing/how-to-report-a-bug).`,
|
||||
`| :warning: | Missing Reproducible Example |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Type: Unsupported Version':
|
||||
await addComment(
|
||||
`> [!WARNING]\n` +
|
||||
`> **Unsupported version**: It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
|
||||
`| :warning: | Unsupported Version of React Native |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Type: Too Old Version':
|
||||
await addComment(
|
||||
`> [!CAUTION]\n` +
|
||||
`> **Too old version**: It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
|
||||
`| :warning: | Too Old Version of React Native |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
export GITHUB_OWNER=-facebook
|
||||
export GITHUB_REPO=-react-native
|
||||
|
||||
{
|
||||
echo eslint
|
||||
npm run lint --silent -- --format=json
|
||||
|
||||
echo flow
|
||||
npm run flow-check --silent --json
|
||||
} | node private/react-native-bots/code-analysis-bot.js
|
||||
|
||||
STATUS=$?
|
||||
if [ $STATUS == 0 ]; then
|
||||
echo "Code analyzed successfully."
|
||||
else
|
||||
echo "Code analysis failed, error status $STATUS."
|
||||
fi
|
||||
exit $STATUS
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
GITHUB_OWNER=-facebook
|
||||
GITHUB_REPO=-react-native
|
||||
export GITHUB_OWNER
|
||||
export GITHUB_REPO
|
||||
|
||||
if [ -x "$(command -v shellcheck)" ]; then
|
||||
IFS=$'\n'
|
||||
|
||||
find . \
|
||||
-type f \
|
||||
-not -path "*node_modules*" \
|
||||
-not -path "*third-party*" \
|
||||
-name '*.sh' \
|
||||
-exec sh -c 'shellcheck "$1"' -- {} \;
|
||||
|
||||
else
|
||||
echo 'shellcheck is not installed. See https://github.com/facebook/react-native/wiki/Development-Dependencies#shellcheck for instructions.'
|
||||
exit 1
|
||||
fi
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
const NEEDS_REPRO_LABEL = 'Needs: Repro';
|
||||
const NEEDS_AUTHOR_FEEDBACK_LABEL = 'Needs: Author Feedback';
|
||||
const NEEDS_REPRO_HEADER = 'Missing Reproducible Example';
|
||||
const NEEDS_REPRO_MESSAGE =
|
||||
`| :warning: | Missing Reproducible Example |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate). A reproducer needs to be in a GitHub repository under your username.</li></ul> |`;
|
||||
const SKIP_ISSUES_OLDER_THAN = '2023-07-01T00:00:00Z';
|
||||
|
||||
module.exports = async (github, context) => {
|
||||
@@ -20,6 +25,7 @@ module.exports = async (github, context) => {
|
||||
|
||||
const issue = await github.rest.issues.get(issueData);
|
||||
const comments = await github.rest.issues.listComments(issueData);
|
||||
|
||||
const author = issue.data.user.login;
|
||||
|
||||
const issueDate = issue.data.created_at;
|
||||
@@ -37,15 +43,14 @@ module.exports = async (github, context) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const botComment = comments.data.find(comment =>
|
||||
comment.body.includes(NEEDS_REPRO_HEADER),
|
||||
);
|
||||
|
||||
const entities = [issue.data, ...comments.data];
|
||||
|
||||
// Look for Snack or a GH repo associated with the user that added an issue or comment
|
||||
const hasValidReproducer = entities.some(entity => {
|
||||
const hasPullRequestRepoLink = containsPattern(
|
||||
entity.body,
|
||||
`https?:\/\/github\.com\/facebook\/react-native\/pull\/\d+\/?`,
|
||||
);
|
||||
|
||||
const hasExpoSnackLink = containsPattern(
|
||||
entity.body,
|
||||
`https?:\\/\\/snack\\.expo\\.dev\\/[^\\s)\\]]+`,
|
||||
@@ -55,7 +60,7 @@ module.exports = async (github, context) => {
|
||||
entity.body,
|
||||
`https?:\\/\\/github\\.com\\/(${entity.user.login})\\/[^/]+\\/?\\s?`,
|
||||
);
|
||||
return hasPullRequestRepoLink || hasExpoSnackLink || hasGithubRepoLink;
|
||||
return hasExpoSnackLink || hasGithubRepoLink;
|
||||
});
|
||||
|
||||
if (hasValidReproducer) {
|
||||
@@ -69,11 +74,25 @@ module.exports = async (github, context) => {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!botComment) return;
|
||||
|
||||
await github.rest.issues.deleteComment({
|
||||
...issueData,
|
||||
comment_id: botComment.id,
|
||||
});
|
||||
} else {
|
||||
await github.rest.issues.addLabels({
|
||||
...issueData,
|
||||
labels: [NEEDS_REPRO_LABEL, NEEDS_AUTHOR_FEEDBACK_LABEL],
|
||||
});
|
||||
|
||||
if (botComment) return;
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
...issueData,
|
||||
body: NEEDS_REPRO_MESSAGE,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -82,7 +101,7 @@ function containsPattern(body, pattern) {
|
||||
return body.search(regexp) !== -1;
|
||||
}
|
||||
|
||||
// Prevents the bot from responding when maintainer has changed the 'Needs: Repro' label
|
||||
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
|
||||
async function hasMaintainerChangedLabel(github, issueData, author) {
|
||||
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
|
||||
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {
|
||||
prepareFailurePayload,
|
||||
sendMessageToDiscord,
|
||||
} = require('./notifyDiscord');
|
||||
|
||||
function readOutcomes() {
|
||||
const baseDir = '/tmp';
|
||||
let outcomes = [];
|
||||
fs.readdirSync(baseDir).forEach(file => {
|
||||
const fullPath = path.join(baseDir, file);
|
||||
if (fullPath.endsWith('outcome') && fs.statSync(fullPath).isDirectory) {
|
||||
fs.readdirSync(fullPath).forEach(subFile => {
|
||||
const subFullPath = path.join(fullPath, subFile);
|
||||
if (subFullPath.endsWith('outcome')) {
|
||||
const [library, status] = String(fs.readFileSync(subFullPath, 'utf8'))
|
||||
.trim()
|
||||
.split(':');
|
||||
const platform = subFile.includes('android') ? 'Android' : 'iOS';
|
||||
console.log(
|
||||
`[${platform}] ${library} completed with status ${status}`,
|
||||
);
|
||||
outcomes.push({
|
||||
library: library.trim(),
|
||||
platform,
|
||||
status: status.trim(),
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (fullPath.endsWith('outcome')) {
|
||||
const [library, status] = String(fs.readFileSync(fullPath, 'utf8'))
|
||||
.trim()
|
||||
.split(':');
|
||||
const platform = file.includes('android') ? 'Android' : 'iOS';
|
||||
console.log(`[${platform}] ${library} completed with status ${status}`);
|
||||
outcomes.push({
|
||||
library: library.trim(),
|
||||
platform,
|
||||
status: status.trim(),
|
||||
});
|
||||
}
|
||||
});
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
function printFailures(outcomes) {
|
||||
console.log('Printing failures...');
|
||||
let failedLibraries = [];
|
||||
outcomes.forEach(entry => {
|
||||
if (entry.status !== 'success') {
|
||||
console.log(
|
||||
`❌ [${entry.platform}] ${entry.library} failed with status ${entry.status}`,
|
||||
);
|
||||
failedLibraries.push({
|
||||
library: entry.library,
|
||||
platform: entry.platform,
|
||||
});
|
||||
}
|
||||
});
|
||||
return failedLibraries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to Discord with the list of failures.
|
||||
* @param {string} webHook - The Discord webhook URL
|
||||
* @param {Array<Object>} failures - List of failures to report
|
||||
* @returns {Promise<void>} - A promise that resolves when the message is sent
|
||||
*/
|
||||
async function notifyDiscord(webHook, failures) {
|
||||
if (!webHook) {
|
||||
console.error('Discord webhook URL is missing');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!failures || failures.length === 0) {
|
||||
console.log('No failures to report to Discord');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Use the prepareFailurePayload function to format the message
|
||||
const message = prepareFailurePayload(failures);
|
||||
|
||||
// Use the sendMessageToDiscord function to send the message
|
||||
await sendMessageToDiscord(webHook, message);
|
||||
} catch (error) {
|
||||
console.error('Error in notifyDiscord function:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async function collectResults(discordWebHook) {
|
||||
const outcomes = readOutcomes();
|
||||
const failures = printFailures(outcomes);
|
||||
|
||||
if (failures.length > 0) {
|
||||
if (discordWebHook) {
|
||||
console.log('Sending to discord');
|
||||
await notifyDiscord(discordWebHook, failures);
|
||||
} else {
|
||||
console.log('Web hook not set');
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('✅ All tests passed!');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
collectResults,
|
||||
notifyDiscord,
|
||||
};
|
||||
@@ -1,137 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {log, run} = require('./utils');
|
||||
const fs = require('fs');
|
||||
|
||||
function _headers(token) {
|
||||
return {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
}
|
||||
|
||||
function _extractChangelog(version) {
|
||||
if (version.endsWith('.0')) {
|
||||
// for RC.0 and for the release of a new stable minor, the changelog is too long
|
||||
// to be added in a release. The release body is usually something shorter.
|
||||
// See for example the release for 0.76.0 or 0.77.0:
|
||||
// 0.76: https://github.com/facebook/react-native/releases/tag/v0.76.0
|
||||
// 0.77: https://github.com/facebook/react-native/releases/tag/v0.77.0
|
||||
return '';
|
||||
}
|
||||
const changelog = String(fs.readFileSync('CHANGELOG.md', 'utf8')).split('\n');
|
||||
const changelogStarts = changelog.indexOf(`## v${version}`);
|
||||
let changelogEnds = changelogStarts;
|
||||
// Scan the changelog to find the next version
|
||||
for (var line = changelogStarts + 1; line < changelog.length; line++) {
|
||||
if (changelog[line].startsWith('## ')) {
|
||||
changelogEnds = line;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return changelog.slice(changelogStarts, changelogEnds).join('\n').trim();
|
||||
}
|
||||
|
||||
function _computeBody(version, changelog) {
|
||||
return `${changelog}
|
||||
|
||||
---
|
||||
|
||||
Hermes dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
ReactNativeDependencies dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
|
||||
|
||||
---
|
||||
|
||||
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
|
||||
|
||||
---
|
||||
|
||||
To help you upgrade to this version, you can use the [Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) ⚛️.
|
||||
|
||||
---
|
||||
|
||||
View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/react-native/blob/main/CHANGELOG.md).`;
|
||||
}
|
||||
|
||||
async function _verifyTagExists(version) {
|
||||
const url = `https://github.com/facebook/react-native/releases/tag/v${version}`;
|
||||
|
||||
const response = await fetch(url);
|
||||
if (response.status === 404) {
|
||||
throw new Error(`Tag v${version} does not exist`);
|
||||
}
|
||||
}
|
||||
|
||||
async function _createDraftReleaseOnGitHub(version, body, latest, token) {
|
||||
const url = 'https://api.github.com/repos/facebook/react-native/releases';
|
||||
const method = 'POST';
|
||||
const headers = _headers(token);
|
||||
const fetchBody = JSON.stringify({
|
||||
tag_name: `v${version}`,
|
||||
name: `${version}`,
|
||||
body: body,
|
||||
draft: true, // NEVER CHANGE this value to false. If false, it will publish the release, and send a GH notification to all the subscribers.
|
||||
prerelease: version.includes('-rc.') ? true : false,
|
||||
make_latest: `${latest}`,
|
||||
});
|
||||
|
||||
const response = await fetch(url, {
|
||||
method,
|
||||
headers,
|
||||
body: fetchBody,
|
||||
});
|
||||
|
||||
if (response.status !== 201) {
|
||||
throw new Error(
|
||||
`Failed to create the release: ${response.status} ${response.statusText}`,
|
||||
);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data.html_url;
|
||||
}
|
||||
|
||||
function moveToChangelogBranch(version) {
|
||||
log(`Moving to changelog branch: changelog/v${version}`);
|
||||
run(`git checkout -b changelog/v${version}`);
|
||||
}
|
||||
|
||||
async function createDraftRelease(version, latest, token) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
_verifyTagExists(version);
|
||||
moveToChangelogBranch(version);
|
||||
const changelog = _extractChangelog(version);
|
||||
const body = _computeBody(version, changelog);
|
||||
const release = await _createDraftReleaseOnGitHub(
|
||||
version,
|
||||
body,
|
||||
latest,
|
||||
token,
|
||||
);
|
||||
log(`Created draft release: ${release}`);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createDraftRelease,
|
||||
// Exported for testing purposes
|
||||
_verifyTagExists,
|
||||
_extractChangelog,
|
||||
_computeBody,
|
||||
_createDraftReleaseOnGitHub,
|
||||
};
|
||||
@@ -1,61 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const MSEC_IN_DAY = 1000 * 60 * 60 * 24;
|
||||
|
||||
function formatUsers(users) {
|
||||
console.log(`${users[0]} ${users[1]}`.trim());
|
||||
}
|
||||
|
||||
function extractUsersFromScheduleAndDate(schedule, userMap, date) {
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1; // 0 is January, 1 is February
|
||||
const day = date.getDate();
|
||||
const dateStr = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day}`;
|
||||
const user1 = userMap[schedule[dateStr][0]];
|
||||
const user2 = userMap[schedule[dateStr][1]];
|
||||
return [user1, user2];
|
||||
}
|
||||
|
||||
function main() {
|
||||
const configuration = process.argv[2];
|
||||
const {userMap, schedule} = JSON.parse(configuration);
|
||||
extractIssueOncalls(schedule, userMap);
|
||||
}
|
||||
|
||||
function extractIssueOncalls(schedule, userMap) {
|
||||
const now = new Date();
|
||||
const dayOfTheWeek = now.getDay(); // 0 is Sunday, 1 is Monday, etc.
|
||||
let users;
|
||||
if (dayOfTheWeek === 2) {
|
||||
// exact match in the schedule
|
||||
users = extractUsersFromScheduleAndDate(schedule, userMap, now);
|
||||
} else if (dayOfTheWeek < 2) {
|
||||
// sunday
|
||||
// go to the tuesday of the last week
|
||||
const lastWeekTuesday = new Date(now - (5 + dayOfTheWeek) * MSEC_IN_DAY);
|
||||
users = extractUsersFromScheduleAndDate(schedule, userMap, lastWeekTuesday);
|
||||
} else if (dayOfTheWeek > 1) {
|
||||
// go to the previous tuesday
|
||||
const thisWeekTuesday = new Date(now - (dayOfTheWeek - 2) * MSEC_IN_DAY);
|
||||
users = extractUsersFromScheduleAndDate(schedule, userMap, thisWeekTuesday);
|
||||
}
|
||||
formatUsers(users);
|
||||
return users;
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
void main();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
extractIssueOncalls,
|
||||
};
|
||||
@@ -1,120 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {log, getNpmPackageInfo, run} = require('./utils');
|
||||
|
||||
async function _computePreviousVersionFrom(version) {
|
||||
log(`Computing previous version from: ${version}`);
|
||||
const regex = /^0\.(\d+)\.(\d+)(-rc\.(\d+))?$/;
|
||||
const match = version.match(regex);
|
||||
if (!match) {
|
||||
throw new Error(`Invalid version format: ${version}`);
|
||||
}
|
||||
|
||||
const minor = match[1];
|
||||
const patch = match[2];
|
||||
const rc = match[4];
|
||||
|
||||
if (rc) {
|
||||
if (Number(rc) > 0) {
|
||||
return `0.${minor}.${patch}-rc.${Number(rc) - 1}`;
|
||||
}
|
||||
//fetch latest version on NPM
|
||||
const latestPkg = await getNpmPackageInfo('react-native', 'latest');
|
||||
return latestPkg.version;
|
||||
} else {
|
||||
if (Number(patch) === 0) {
|
||||
// No need to generate the changelog for 0.X.0 as we already generated it from RCs
|
||||
log(
|
||||
`Skipping changelog generation for ${version} as we already have it from the RCs`,
|
||||
);
|
||||
return null;
|
||||
}
|
||||
return `0.${minor}.${Number(patch) - 1}`;
|
||||
}
|
||||
}
|
||||
|
||||
function _generateChangelog(previousVersion, version, token) {
|
||||
log(`Generating changelog for ${version} from ${previousVersion}`);
|
||||
run('git checkout main');
|
||||
run('git fetch');
|
||||
run('git pull origin main');
|
||||
const generateChangelogComand = `npx @rnx-kit/rn-changelog-generator --base v${previousVersion} --compare v${version} --repo . --changelog ./CHANGELOG.md --token ${token}`;
|
||||
run(generateChangelogComand);
|
||||
}
|
||||
|
||||
function _pushCommit(version) {
|
||||
log(`Pushing commit to changelog/v${version}`);
|
||||
run(`git checkout -b changelog/v${version}`);
|
||||
run('git add CHANGELOG.md');
|
||||
run(`git commit -m "[RN][Changelog] Add changelog for v${version}"`);
|
||||
run(`git push origin changelog/v${version}`);
|
||||
}
|
||||
|
||||
async function _createPR(version, token) {
|
||||
log('Creating changelog pr');
|
||||
const url = 'https://api.github.com/repos/facebook/react-native/pulls';
|
||||
const body = `
|
||||
## Summary
|
||||
Add Changelog for ${version}
|
||||
|
||||
## Changelog:
|
||||
[Internal] - Add Changelog for ${version}
|
||||
|
||||
## Test Plan:
|
||||
N/A`;
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'Accept: application/vnd.github+json',
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
title: `[RN][Changelog] Add changelog for v${version}`,
|
||||
head: `changelog/v${version}`,
|
||||
base: 'main',
|
||||
body: body,
|
||||
}),
|
||||
});
|
||||
|
||||
if (response.status !== 201) {
|
||||
throw new Error(
|
||||
`Failed to create PR: ${response.status} ${response.statusText}`,
|
||||
);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data.html_url;
|
||||
}
|
||||
|
||||
async function generateChangelog(version, token) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
const previousVersion = await _computePreviousVersionFrom(version);
|
||||
if (previousVersion) {
|
||||
log(`Previous version is ${previousVersion}`);
|
||||
_generateChangelog(previousVersion, version, token);
|
||||
_pushCommit(version);
|
||||
const prURL = await _createPR(version, token);
|
||||
log(`Created PR: ${prURL}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
generateChangelog,
|
||||
// Exported only for testing purposes:
|
||||
_computePreviousVersionFrom,
|
||||
_generateChangelog,
|
||||
_pushCommit,
|
||||
_createPR,
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
set -e
|
||||
|
||||
if git ls-files | grep -E '\.npmignore$'; then
|
||||
echo "Error: Found unexpected .npmignore file(s). Please use package.json#files instead."
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,152 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const fs = require('fs');
|
||||
|
||||
const usage = `
|
||||
=== Usage ===
|
||||
node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_directory>
|
||||
|
||||
@param {string} appPath - Path to the app APK
|
||||
@param {string} appId - App ID that needs to be launched
|
||||
@param {string} maestroFlow - Path to the maestro flow to be executed
|
||||
@param {string} flavor - Flavor of the app to be launched. Can be 'release' or 'debug'
|
||||
@param {string} workingDirectory - Working directory from where to run Metro
|
||||
==============
|
||||
`;
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
if (args.length !== 5) {
|
||||
throw new Error(`Invalid number of arguments.\n${usage}`);
|
||||
}
|
||||
|
||||
const APP_PATH = args[0];
|
||||
const APP_ID = args[1];
|
||||
const MAESTRO_FLOW = args[2];
|
||||
const IS_DEBUG = args[3] === 'debug';
|
||||
const WORKING_DIRECTORY = args[4];
|
||||
|
||||
const MAX_ATTEMPTS = 3;
|
||||
|
||||
async function executeFlowWithRetries(flow, currentAttempt) {
|
||||
try {
|
||||
console.info(`Executing flow: ${flow}`);
|
||||
const timeout = 1000 * 60 * 10; // 10 minutes
|
||||
childProcess.execSync(
|
||||
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test ${flow} --format junit -e APP_ID=${APP_ID} --debug-output /tmp/MaestroLogs`,
|
||||
{stdio: 'inherit', timeout},
|
||||
);
|
||||
} catch (err) {
|
||||
if (currentAttempt < MAX_ATTEMPTS) {
|
||||
console.info(`Retrying...`);
|
||||
await executeFlowWithRetries(flow, currentAttempt + 1);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function executeFlowInFolder(flowFolder) {
|
||||
const files = fs.readdirSync(flowFolder);
|
||||
for (const file of files) {
|
||||
const filePath = `${flowFolder}/${file}`;
|
||||
if (fs.lstatSync(filePath).isDirectory()) {
|
||||
await executeFlowInFolder(filePath);
|
||||
} else {
|
||||
await executeFlowWithRetries(filePath, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
console.info('\n==============================');
|
||||
console.info('Running tests for Android with the following parameters:');
|
||||
console.info(`APP_PATH: ${APP_PATH}`);
|
||||
console.info(`APP_ID: ${APP_ID}`);
|
||||
console.info(`MAESTRO_FLOW: ${MAESTRO_FLOW}`);
|
||||
console.info(`IS_DEBUG: ${IS_DEBUG}`);
|
||||
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
|
||||
console.info('==============================\n');
|
||||
|
||||
console.info('Install app');
|
||||
childProcess.execSync(`adb install ${APP_PATH}`, {stdio: 'ignore'});
|
||||
|
||||
let metroProcess = null;
|
||||
if (IS_DEBUG) {
|
||||
console.info('Start Metro');
|
||||
childProcess.execSync(`cd ${WORKING_DIRECTORY}`, {stdio: 'ignore'});
|
||||
metroProcess = childProcess.spawn('yarn', ['start', '&'], {
|
||||
cwd: WORKING_DIRECTORY,
|
||||
stdio: 'ignore',
|
||||
detached: true,
|
||||
});
|
||||
metroProcess.unref();
|
||||
console.info(`- Metro PID: ${metroProcess.pid}`);
|
||||
|
||||
console.info('Wait For Metro to Start');
|
||||
await sleep(5000);
|
||||
}
|
||||
|
||||
console.info('Start the app');
|
||||
childProcess.execSync(`adb shell monkey -p ${APP_ID} 1`, {stdio: 'ignore'});
|
||||
|
||||
if (IS_DEBUG) {
|
||||
console.info('Wait For App to warm from Metro');
|
||||
await sleep(10000);
|
||||
}
|
||||
|
||||
console.info('Start recording to /sdcard/screen.mp4');
|
||||
childProcess
|
||||
.exec('adb shell screenrecord /sdcard/screen.mp4', {
|
||||
stdio: 'ignore',
|
||||
detached: true,
|
||||
})
|
||||
.unref();
|
||||
|
||||
console.info(`Start testing ${MAESTRO_FLOW}`);
|
||||
let error = null;
|
||||
try {
|
||||
//check if MAESTRO_FLOW is a folder
|
||||
if (
|
||||
fs.existsSync(MAESTRO_FLOW) &&
|
||||
fs.lstatSync(MAESTRO_FLOW).isDirectory()
|
||||
) {
|
||||
await executeFlowInFolder(MAESTRO_FLOW);
|
||||
} else {
|
||||
await executeFlowWithRetries(MAESTRO_FLOW, 0);
|
||||
}
|
||||
} catch (err) {
|
||||
error = err;
|
||||
} finally {
|
||||
console.info('Stop recording');
|
||||
childProcess.execSync('adb pull /sdcard/screen.mp4', {stdio: 'ignore'});
|
||||
|
||||
if (IS_DEBUG && metroProcess != null) {
|
||||
const pid = metroProcess.pid;
|
||||
console.info(`Kill Metro. PID: ${pid}`);
|
||||
process.kill(pid);
|
||||
console.info(`Metro Killed`);
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -1,176 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const fs = require('fs');
|
||||
|
||||
const usage = `
|
||||
=== Usage ===
|
||||
node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_directory>
|
||||
|
||||
@param {string} appPath - Path to the app APK
|
||||
@param {string} appId - App ID that needs to be launched
|
||||
@param {string} maestroFlow - Path to the maestro flow to be executed
|
||||
@param {string} jsengine - The JSEngine to use for the test
|
||||
@param {string} flavor - Flavor of the app to be launched. Can be 'Release' or 'Debug'
|
||||
@param {string} workingDirectory - Working directory from where to run Metro
|
||||
==============
|
||||
`;
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
if (args.length !== 6) {
|
||||
throw new Error(`Invalid number of arguments.\n${usage}`);
|
||||
}
|
||||
|
||||
const APP_PATH = args[0];
|
||||
const APP_ID = args[1];
|
||||
const MAESTRO_FLOW = args[2];
|
||||
const JS_ENGINE = args[3];
|
||||
const IS_DEBUG = args[4] === 'Debug';
|
||||
const WORKING_DIRECTORY = args[5];
|
||||
|
||||
const MAX_ATTEMPTS = 5;
|
||||
|
||||
function launchSimulator(simulatorName) {
|
||||
console.log(`Launching simulator ${simulatorName}`);
|
||||
try {
|
||||
childProcess.execSync(`xcrun simctl boot "${simulatorName}"`);
|
||||
} catch (error) {
|
||||
if (
|
||||
!error.message.includes('Unable to boot device in current state: Booted')
|
||||
) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function installAppOnSimulator(appPath) {
|
||||
console.log(`Installing app at path ${appPath}`);
|
||||
childProcess.execSync(`xcrun simctl install booted "${appPath}"`);
|
||||
}
|
||||
|
||||
function extractSimulatorUDID() {
|
||||
console.log('Retrieving device UDID');
|
||||
const command = `xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid'`;
|
||||
const udid = String(childProcess.execSync(command)).trim();
|
||||
console.log(`UDID is ${udid}`);
|
||||
return udid;
|
||||
}
|
||||
|
||||
function bringSimulatorInForeground() {
|
||||
console.log('Bringing simulator in foreground');
|
||||
childProcess.execSync('open -a simulator');
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
}
|
||||
|
||||
async function launchAppOnSimulator(appId, udid, isDebug) {
|
||||
console.log('Launch the app');
|
||||
childProcess.execSync(`xcrun simctl launch "${udid}" "${appId}"`);
|
||||
|
||||
if (isDebug) {
|
||||
console.log('Wait for metro to warm');
|
||||
await sleep(20 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function startVideoRecording(jsengine, currentAttempt) {
|
||||
console.log(
|
||||
`Start video record using pid: video_record_${jsengine}_${currentAttempt}.pid`,
|
||||
);
|
||||
|
||||
const recordingArgs =
|
||||
`simctl io booted recordVideo video_record_${jsengine}_${currentAttempt}.mov`.split(
|
||||
' ',
|
||||
);
|
||||
const recordingProcess = childProcess.spawn('xcrun', recordingArgs, {
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
});
|
||||
|
||||
return recordingProcess;
|
||||
}
|
||||
|
||||
function stopVideoRecording(recordingProcess) {
|
||||
if (!recordingProcess) {
|
||||
console.log("Passed a null recording process. Can't kill it");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Stop video record using pid: ${recordingProcess.pid}`);
|
||||
|
||||
recordingProcess.kill('SIGINT');
|
||||
}
|
||||
|
||||
function executeTestsWithRetries(
|
||||
appId,
|
||||
udid,
|
||||
maestroFlow,
|
||||
jsengine,
|
||||
currentAttempt,
|
||||
) {
|
||||
const recProcess = startVideoRecording(jsengine, currentAttempt);
|
||||
try {
|
||||
const timeout = 1000 * 60 * 10; // 10 minutes
|
||||
const command = `$HOME/.maestro/bin/maestro --udid="${udid}" test "${maestroFlow}" --format junit -e APP_ID="${appId}"`;
|
||||
console.log(command);
|
||||
childProcess.execSync(`MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 ${command}`, {
|
||||
stdio: 'inherit',
|
||||
timeout,
|
||||
});
|
||||
|
||||
stopVideoRecording(recProcess);
|
||||
} catch (error) {
|
||||
// Can't put this in the finally block because it will be executed after the
|
||||
// recursive call of executeTestsWithRetries
|
||||
stopVideoRecording(recProcess);
|
||||
|
||||
if (currentAttempt < MAX_ATTEMPTS) {
|
||||
executeTestsWithRetries(
|
||||
appId,
|
||||
udid,
|
||||
maestroFlow,
|
||||
jsengine,
|
||||
currentAttempt + 1,
|
||||
);
|
||||
} else {
|
||||
console.error(`Failed to execute flow after ${MAX_ATTEMPTS} attempts.`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
console.info('\n==============================');
|
||||
console.info('Running tests for iOS with the following parameters:');
|
||||
console.info(`APP_PATH: ${APP_PATH}`);
|
||||
console.info(`APP_ID: ${APP_ID}`);
|
||||
console.info(`MAESTRO_FLOW: ${MAESTRO_FLOW}`);
|
||||
console.info(`JS_ENGINE: ${JS_ENGINE}`);
|
||||
console.info(`IS_DEBUG: ${IS_DEBUG}`);
|
||||
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
|
||||
console.info('==============================\n');
|
||||
|
||||
const simulatorName = 'iPhone 15 Pro';
|
||||
launchSimulator(simulatorName);
|
||||
installAppOnSimulator(APP_PATH);
|
||||
const udid = extractSimulatorUDID();
|
||||
bringSimulatorInForeground();
|
||||
await launchAppOnSimulator(APP_ID, udid, IS_DEBUG);
|
||||
executeTestsWithRetries(APP_ID, udid, MAESTRO_FLOW, JS_ENGINE, 1);
|
||||
console.log('Test finished');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -1,90 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sends a message to Discord using the webhook URL.
|
||||
* @param {string} webHook - The Discord webhook URL
|
||||
* @param {Object} message - The message to send
|
||||
* @returns {Promise<void>} - A promise that resolves when the message is sent
|
||||
*/
|
||||
async function sendMessageToDiscord(webHook, message) {
|
||||
if (!webHook) {
|
||||
throw new Error('Discord webhook URL is missing');
|
||||
}
|
||||
|
||||
// Send the request using fetch
|
||||
const response = await fetch(webHook, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(message),
|
||||
});
|
||||
|
||||
// Handle the response
|
||||
if (response.ok) {
|
||||
console.log('Successfully sent message to Discord');
|
||||
return;
|
||||
} else {
|
||||
const errorText = await response.text();
|
||||
console.error(
|
||||
`Failed to send message to Discord: ${response.status} ${errorText}`,
|
||||
);
|
||||
throw new Error(`HTTP status code: ${response.status}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares a formatted Discord message payload from a list of failures.
|
||||
* @param {Array<Object>} failures - List of failures to format
|
||||
* @returns {Object} - The formatted Discord message payload
|
||||
*/
|
||||
function prepareFailurePayload(failures) {
|
||||
if (!failures || failures.length === 0) {
|
||||
return {
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
|
||||
};
|
||||
}
|
||||
|
||||
// Sort failures by platform and then by library name
|
||||
const sortedFailures = [...failures].sort((a, b) => {
|
||||
// First sort by platform
|
||||
const platformA = a.platform || 'Unknown';
|
||||
const platformB = b.platform || 'Unknown';
|
||||
|
||||
if (platformA !== platformB) {
|
||||
return platformA.localeCompare(platformB);
|
||||
}
|
||||
|
||||
// Then sort by library name
|
||||
const libraryA = a.library || 'Unknown';
|
||||
const libraryB = b.library || 'Unknown';
|
||||
return libraryA.localeCompare(libraryB);
|
||||
});
|
||||
|
||||
// Format the failures into a message
|
||||
const formattedFailures = sortedFailures
|
||||
.map(failure => {
|
||||
const library = failure.library || 'Unknown';
|
||||
const platform = failure.platform || 'Unknown';
|
||||
return `❌ [${platform}] ${library}`;
|
||||
})
|
||||
.join('\n');
|
||||
|
||||
return {
|
||||
content: `⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n${formattedFailures}`,
|
||||
};
|
||||
}
|
||||
|
||||
// Export the functions using CommonJS syntax
|
||||
module.exports = {
|
||||
prepareFailurePayload,
|
||||
sendMessageToDiscord,
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {run, sleep, log} = require('./utils.js');
|
||||
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
|
||||
|
||||
const TAG_AS_LATEST_REGEX = /#publish-packages-to-npm&latest/;
|
||||
|
||||
/**
|
||||
* Should this commit be `latest` on npm?
|
||||
*/
|
||||
function isLatest() {
|
||||
const commitMessage = run('git log -n1 --pretty=%B');
|
||||
return TAG_AS_LATEST_REGEX.test(commitMessage);
|
||||
}
|
||||
module.exports.isLatest = isLatest;
|
||||
|
||||
/**
|
||||
* Create a Github Action to publish the community template matching the released version
|
||||
* of React Native.
|
||||
*/
|
||||
module.exports.publishTemplate = async (github, version, dryRun = true) => {
|
||||
log(`📤 Get the ${TEMPLATE_NPM_PKG} repo to publish ${version}`);
|
||||
|
||||
const is_latest_on_npm = isLatest();
|
||||
|
||||
const majorMinor = /^v?(\d+\.\d+)/.exec(version);
|
||||
|
||||
if (!majorMinor) {
|
||||
log(`🔥 can't capture MAJOR.MINOR from '${version}', giving up.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// MAJOR.MINOR-stable
|
||||
const ref = `${majorMinor[1]}-stable`;
|
||||
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: 'react-native-community',
|
||||
repo: 'template',
|
||||
workflow_id: 'release.yaml',
|
||||
ref,
|
||||
inputs: {
|
||||
dry_run: dryRun,
|
||||
is_latest_on_npm,
|
||||
// 0.75.0-rc.0, note no 'v' prefix
|
||||
version: version.replace(/^v/, ''),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
|
||||
const TEMPLATE_NPM_PKG = '@react-native-community/template';
|
||||
|
||||
/**
|
||||
* Will verify that @latest and the @<version> have been published.
|
||||
*
|
||||
* NOTE: This will infinitely query each step until successful, make sure the
|
||||
* calling job has a timeout.
|
||||
*/
|
||||
module.exports.verifyPublishedTemplate = async (
|
||||
version,
|
||||
latest = false,
|
||||
retries = MAX_RETRIES,
|
||||
) => {
|
||||
try {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.slice(1);
|
||||
}
|
||||
await verifyPublishedPackage(
|
||||
TEMPLATE_NPM_PKG,
|
||||
version,
|
||||
latest ? 'latest' : null,
|
||||
retries,
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {execSync} = require('child_process');
|
||||
|
||||
const log = (...args) => console.log(...args);
|
||||
|
||||
async function getNpmPackageInfo(pkg, versionOrTag) {
|
||||
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
|
||||
resp.json(),
|
||||
);
|
||||
}
|
||||
|
||||
async function sleep(seconds) {
|
||||
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
||||
}
|
||||
|
||||
function run(cmd) {
|
||||
return execSync(cmd, 'utf8').toString().trim();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
log,
|
||||
getNpmPackageInfo,
|
||||
sleep,
|
||||
run,
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {log, sleep} = require('./utils');
|
||||
|
||||
const SLEEP_S = 60; // 1 minute
|
||||
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
|
||||
const ARTIFACT_URL =
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
|
||||
const ARTIFACT_NAME = 'react-native-artifacts-';
|
||||
|
||||
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
|
||||
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
|
||||
const response = await fetch(artifactUrl);
|
||||
|
||||
if (response.status !== 200) {
|
||||
log(
|
||||
`${currentAttempt}) Artifact's for version ${version} are not on maven yet.\nURL: ${artifactUrl}\nLet's wait a minute and try again.\n`,
|
||||
);
|
||||
await sleep(SLEEP_S);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
log(
|
||||
`We waited 90 minutes for the artifacts to be on Maven. Check https://status.maven.org/ if there are issues wth the service.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
module.exports = {verifyArtifactsAreOnMaven};
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {log, getNpmPackageInfo, sleep} = require('./utils');
|
||||
|
||||
const SLEEP_S = 10;
|
||||
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
|
||||
|
||||
async function verifyPublishedPackage(
|
||||
packageName,
|
||||
version,
|
||||
tag = null,
|
||||
retries = MAX_RETRIES,
|
||||
) {
|
||||
log(`🔍 Is ${packageName}@${version} on npm?`);
|
||||
|
||||
let count = retries;
|
||||
while (count-- > 0) {
|
||||
try {
|
||||
const json = await getNpmPackageInfo(packageName, tag ? tag : version);
|
||||
log(`🎉 Found ${packageName}@${version} on npm`);
|
||||
if (!tag) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check for next tag
|
||||
if (tag === 'next' && json.version === version) {
|
||||
log(`🎉 ${packageName}@next → ${version} on npm`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for latest tag
|
||||
if (tag === 'latest' && json.version === version) {
|
||||
log(`🎉 ${packageName}@latest → ${version} on npm`);
|
||||
return;
|
||||
}
|
||||
|
||||
log(
|
||||
`🐌 ${packageName}@${tag} → ${json.version} on npm and not ${version} as expected, retrying...`,
|
||||
);
|
||||
} catch (e) {
|
||||
log(`Nope, fetch failed: ${e.message}`);
|
||||
}
|
||||
await sleep(SLEEP_S);
|
||||
}
|
||||
|
||||
let msg = `🚨 Timed out when trying to verify ${packageName}@${version} on npm`;
|
||||
if (tag) {
|
||||
msg += ` and ${tag} tag points to this version.`;
|
||||
}
|
||||
log(msg);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
verifyPublishedPackage,
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {run, sleep, log} = require('./utils.js');
|
||||
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
|
||||
const REACT_NATIVE_NPM_PKG = 'react-native';
|
||||
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
|
||||
/**
|
||||
* Will verify that @latest, @next and the @<version> have been published.
|
||||
*
|
||||
* NOTE: This will infinitely query each step until successful, make sure the
|
||||
* calling job has a timeout.
|
||||
*/
|
||||
module.exports.verifyReleaseOnNpm = async (
|
||||
version,
|
||||
latest = false,
|
||||
retries = MAX_RETRIES,
|
||||
) => {
|
||||
const tag = version.includes('-rc.') ? 'next' : latest ? 'latest' : null;
|
||||
if (version.startsWith('v')) {
|
||||
version = version.slice(1);
|
||||
}
|
||||
await verifyPublishedPackage(REACT_NATIVE_NPM_PKG, version, tag, retries);
|
||||
};
|
||||
@@ -10,6 +10,11 @@
|
||||
module.exports = async (github, context) => {
|
||||
const issue = context.payload.issue;
|
||||
|
||||
// Ignore issues using upgrade template (they use a special label)
|
||||
if (issue.labels.find(label => label.name === 'Type: Upgrade Issue')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const issueVersionUnparsed =
|
||||
getReactNativeVersionFromIssueBodyIfExists(issue);
|
||||
const issueVersion = parseVersionFromString(issueVersionUnparsed);
|
||||
@@ -45,6 +50,18 @@ module.exports = async (github, context) => {
|
||||
if (!isVersionSupported(issueVersion, latestVersion)) {
|
||||
return {label: 'Type: Unsupported Version'};
|
||||
}
|
||||
|
||||
// We want to encourage users to repro the issue on the highest available patch for the given minor.
|
||||
const latestPatchForVersion = getLatestPatchForVersion(
|
||||
issueVersion,
|
||||
recentReleases,
|
||||
);
|
||||
if (latestPatchForVersion > issueVersion.patch) {
|
||||
return {
|
||||
label: 'Newer Patch Available',
|
||||
newestPatch: `${issueVersion.major}.${issueVersion.minor}.${latestPatchForVersion}`,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -75,6 +92,22 @@ function isVersionTooOld(actualVersion, latestVersion) {
|
||||
);
|
||||
}
|
||||
|
||||
// Assumes that releases are sorted in the order of recency (i.e. most recent releases are earlier in the list)
|
||||
// This enables us to stop looking as soon as we find the first release with a matching major/minor version, since
|
||||
// we know it's the most recent release, therefore the highest patch available.
|
||||
function getLatestPatchForVersion(version, releases) {
|
||||
for (releaseName of releases) {
|
||||
const release = parseVersionFromString(releaseName);
|
||||
if (
|
||||
release &&
|
||||
release.major == version.major &&
|
||||
release.minor == version.minor
|
||||
) {
|
||||
return release.patch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getReactNativeVersionFromIssueBodyIfExists(issue) {
|
||||
if (!issue || !issue.body) return;
|
||||
const rnVersionRegex = /React Native Version[\r\n]+(?<version>.+)[\r\n]*/;
|
||||
|
||||
@@ -24,4 +24,4 @@ jobs:
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@1.8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
name: Bump Podfile.lock
|
||||
|
||||
on:
|
||||
workflow_call: # this directive allow us to call this workflow from other workflows
|
||||
|
||||
jobs:
|
||||
bump-podfile-lock:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Extract branch name
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}";
|
||||
BRANCH_NAME=$(echo "$TAG" | sed -E 's/v([0-9]+\.[0-9]+)\.[0-9]+(-rc\.[0-9]+)?/\1-stable/')
|
||||
echo "Branch Name is $BRANCH_NAME"
|
||||
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
|
||||
- name: Checkout release branch
|
||||
run: |
|
||||
git checkout "$BRANCH_NAME"
|
||||
git fetch
|
||||
git pull origin "$BRANCH_NAME"
|
||||
- name: Bump podfile.lock
|
||||
run: |
|
||||
cd packages/rn-tester
|
||||
bundle install
|
||||
bundle exec pod update hermes-engine --no-repo-update
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add packages/rn-tester/Podfile.lock
|
||||
git commit -m "[LOCAL] Bump Podfile.lock"
|
||||
git push origin "$BRANCH_NAME"
|
||||
@@ -1,20 +0,0 @@
|
||||
name: Keep Github Actions Cache < 10GB
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Run every 2hrs during weekdays
|
||||
- cron: "0 0/2 * * 1-5"
|
||||
|
||||
jobs:
|
||||
cache-cleaner:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Trim the cache
|
||||
run: node scripts/clean-gha-cache.js
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const checkForReproducer = require('./.github/workflow-scripts/checkForReproducer.js')
|
||||
await checkForReproducer(github, context)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# This jobs runs every day 2 hours after the nightly job and its purpose is to report
|
||||
# a failure in case the nightly failed to be published. We are going to hook this to an internal automation.
|
||||
name: Check Nightlies
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# nightly build @ 4:15 AM UTC
|
||||
schedule:
|
||||
- cron: '15 4 * * *'
|
||||
|
||||
jobs:
|
||||
check-nightly:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Check nightly
|
||||
run: |
|
||||
TODAY=$(date "+%Y%m%d")
|
||||
echo "Checking nightly for $TODAY"
|
||||
NIGHTLY="$(npm view react-native | grep $TODAY)"
|
||||
if [[ -z $NIGHTLY ]]; then
|
||||
echo 'Nightly job failed.'
|
||||
exit 1
|
||||
else
|
||||
echo 'Nightly Worked, All Good!'
|
||||
fi
|
||||
|
||||
test-libraries:
|
||||
uses: ./.github/workflows/test-libraries-on-nightlies.yml
|
||||
needs: check-nightly
|
||||
secrets:
|
||||
discord_webhook_url: ${{ secrets.NIGHTLY_DISCORD_WEBHOOK }}
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
if(!context.payload.commits || !context.payload.commits.length) return;
|
||||
const sha = context.payload.commits[0].id;
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
issue_number: closedPrNumber,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `This pull request was successfully merged by ${authorName} in **${sha}**\n\n<sup>[When will my fix make it into a release?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#when-will-my-fix-make-it-into-a-release) | [How to file a pick request?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#how-to-open-a-pick-request)</sup>`
|
||||
body: `This pull request was successfully merged by ${authorName} in **${sha}**.\n\n<sup>[When will my fix make it into a release?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#when-will-my-fix-make-it-into-a-release) | [How to file a pick request?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#how-to-open-a-pick-request)</sup>`
|
||||
});
|
||||
|
||||
// If the PR has already been processed (labeled as Merged), skip it
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
name: Create Draft Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
create-draft-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure Git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Create draft release
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
|
||||
const version = '${{ github.ref_name }}';
|
||||
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}');
|
||||
@@ -4,29 +4,29 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
|
||||
description: 'The version of React Native we want to release. For example 0.75.0-rc.0'
|
||||
required: true
|
||||
type: string
|
||||
is-latest-on-npm:
|
||||
description: "Whether we want to tag this release as latest on NPM"
|
||||
is_latest_on_npm:
|
||||
description: 'Whether we want to tag this release as latest on NPM'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
dry-run:
|
||||
description: "Whether the job should be executed in dry-run mode or not"
|
||||
dry_run:
|
||||
description: 'Whether the job should be executed in dry-run mode or not'
|
||||
type: boolean
|
||||
default: true
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: 'true'
|
||||
fetch-depth: 0
|
||||
- name: Check if on stable branch
|
||||
id: check_stable_branch
|
||||
run: |
|
||||
@@ -52,5 +52,5 @@ jobs:
|
||||
uses: ./.github/actions/create-release
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
is-latest-on-npm: ${{ inputs.is-latest-on-npm }}
|
||||
dry-run: ${{ inputs.dry-run }}
|
||||
is_latest_on_npm: ${{ inputs.is_latest_on_npm }}
|
||||
dry_run: ${{ inputs.dry_run }}
|
||||
|
||||
@@ -18,14 +18,11 @@ jobs:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Run diff-js-api-breaking-changes
|
||||
uses: ./.github/actions/diff-js-api-breaking-changes
|
||||
- name: Run Yarn Install on Root
|
||||
run: yarn install
|
||||
working-directory: .
|
||||
- name: Danger
|
||||
run: yarn danger ci --use-github-checks --failOnErrors
|
||||
working-directory: private/react-native-bots
|
||||
working-directory: packages/react-native-bots
|
||||
env:
|
||||
DANGER_GITHUB_API_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
name: Generate Changelog
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
generate-changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure Git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Generate Changelog
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {generateChangelog} = require('./.github/workflow-scripts/generateChangelog');
|
||||
const version = '${{ github.ref_name }}';
|
||||
await generateChangelog(version, '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}');
|
||||
@@ -0,0 +1,13 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v3
|
||||
@@ -1,45 +0,0 @@
|
||||
name: Monitor React Native New Issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0,6,12,18 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
# Reminder for when we have to update the schedule (before Jan 2026):
|
||||
# the secrets.ONCALL_SCHEDULE secret must be on a single line and must have all the `"` escaped as `\"`.
|
||||
# Only a meta engineer can update it through the OSS internal portal.
|
||||
|
||||
jobs:
|
||||
monitor-issues:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Extract next oncall
|
||||
run: |
|
||||
ONCALLS=$(node ./.github/workflow-scripts/extractIssueOncalls.js "${{ secrets.ONCALL_SCHEDULE }}")
|
||||
ONCALL1=$(echo $ONCALLS | cut -d ' ' -f 1)
|
||||
ONCALL2=$(echo $ONCALLS | cut -d ' ' -f 2)
|
||||
echo "oncall1=$ONCALL1" >> $GITHUB_ENV
|
||||
echo "oncall2=$ONCALL2" >> $GITHUB_ENV
|
||||
- name: Print oncalls
|
||||
run: |
|
||||
echo "oncall1: ${{ env.oncall1 }}"
|
||||
echo "oncall2: ${{ env.oncall2 }}"
|
||||
- name: Monitor New Issues
|
||||
uses: react-native-community/repo-monitor@v1.0.1
|
||||
with:
|
||||
task: "monitor-issues"
|
||||
git_secret: ${{ secrets.GITHUB_TOKEN }}
|
||||
notifier: "discord"
|
||||
fetch_data_interval: 6
|
||||
repo_owner: "facebook"
|
||||
repo_name: "react-native"
|
||||
discord_webhook_url: "${{ secrets.DISCORD_WEBHOOK_URL }}"
|
||||
discord_id_type: "user"
|
||||
discord_ids: "${{ env.oncall1 }},${{ env.oncall2 }}"
|
||||
+597
-81
@@ -1,10 +1,11 @@
|
||||
name: Nightly
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# nightly build @ 2:15 AM UTC
|
||||
schedule:
|
||||
- cron: "15 2 * * *"
|
||||
workflow_dispatch:
|
||||
# nightly build @ 2:15 AM UTC
|
||||
schedule:
|
||||
- cron: '15 2 * * *'
|
||||
|
||||
|
||||
jobs:
|
||||
set_release_type:
|
||||
@@ -26,32 +27,54 @@ jobs:
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
BUILD_FROM_SOURCE: true
|
||||
outputs:
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
|
||||
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
|
||||
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
|
||||
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-14
|
||||
runs-on: macos-13
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Build HermesC Apple
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
@@ -60,27 +83,104 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "15.1"
|
||||
IOS_DEPLOYMENT_TARGET: "13.4"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
|
||||
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
slice: ${{ matrix.slice}}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
SLICE=${{ matrix.slice }}
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
|
||||
echo "Final path for this slice is: $FINAL_PATH"
|
||||
|
||||
if [[ -d "$FINAL_PATH" ]]; then
|
||||
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$ARTIFACTS_EXIST" ]]; then
|
||||
echo "[HERMES] Skipping! Artifacts exists already."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
echo "Moving from build_$SLICE to $FINAL_PATH"
|
||||
mv build_"$SLICE" "$FINAL_PATH"
|
||||
|
||||
# check whether everything is there
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
|
||||
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
|
||||
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz
|
||||
- name: Save slice cache
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-14
|
||||
runs-on: macos-13
|
||||
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
@@ -92,22 +192,192 @@ jobs:
|
||||
flavor: [Debug, Release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Hermes MacOS
|
||||
uses: ./.github/actions/build-hermes-macos
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
FLAVOR="${{ matrix.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
secrets: inherit
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: yarn install --non-interactive
|
||||
- name: Slice cache macosx
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
mv build_macosx_${{ matrix.flavor }} build_macosx
|
||||
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
|
||||
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
|
||||
mv build_catalyst_${{ matrix.flavor }} build_catalyst
|
||||
mv build_xros_${{ matrix.flavor }} build_xros
|
||||
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
BUILD_TYPE="${{ matrix.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
|
||||
--inputDir ./packages/react-native/sdks/hermes \
|
||||
--buildType "$BUILD_TYPE" \
|
||||
--outputDir $TARBALL_OUTPUT_DIR)
|
||||
|
||||
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
|
||||
|
||||
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
|
||||
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
|
||||
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
|
||||
mkdir -p "$WORKING_DIR/macosx"
|
||||
mkdir -p "$WORKING_DIR/catalyst"
|
||||
mkdir -p "$WORKING_DIR/iphoneos"
|
||||
mkdir -p "$WORKING_DIR/iphonesimulator"
|
||||
mkdir -p "$WORKING_DIR/xros"
|
||||
mkdir -p "$WORKING_DIR/xrsimulator"
|
||||
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
|
||||
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
|
||||
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
|
||||
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
|
||||
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
|
||||
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
|
||||
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
|
||||
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
|
||||
|
||||
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
|
||||
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
|
||||
|
||||
mkdir -p "$DEST_DIR"
|
||||
mv "hermes.framework.dSYM" "$DEST_DIR"
|
||||
- name: Upload hermes dSYM artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-dSYM-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -117,31 +387,129 @@ jobs:
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Linux
|
||||
uses: ./.github/actions/build-hermesc-linux
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/linux64-bin/
|
||||
/tmp/hermes/hermes/destroot/
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p /tmp/hermes/linux64-bin
|
||||
- name: Build HermesC for Linux
|
||||
run: |
|
||||
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
|
||||
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
|
||||
else
|
||||
cd /tmp/hermes
|
||||
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
|
||||
cmake --build build --target hermesc -j 4
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2019
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Windows
|
||||
uses: ./.github/actions/build-hermesc-windows
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
D:\tmp\hermes\win64-bin\
|
||||
D:\tmp\hermes\hermes\icu\
|
||||
D:\tmp\hermes\hermes\deps\
|
||||
D:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
|
||||
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
|
||||
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
|
||||
- name: Build HermesC for Windows
|
||||
run: |
|
||||
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
|
||||
choco install --no-progress cmake --version 3.14.7
|
||||
if (-not $?) { throw "Failed to install CMake" }
|
||||
|
||||
cd $Env:HERMES_WS_DIR\icu
|
||||
# If Invoke-WebRequest shows a progress bar, it will fail with
|
||||
# Win32 internal error "Access is denied" 0x5 occurred [...]
|
||||
$progressPreference = 'silentlyContinue'
|
||||
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
|
||||
Expand-Archive -Path "icu.zip" -DestinationPath "."
|
||||
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
|
||||
# Include MSVC++ 2015 redistributables
|
||||
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
|
||||
|
||||
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
|
||||
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
|
||||
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
if (-not $?) { throw "Failed to configure Hermes" }
|
||||
echo "Running windows build..."
|
||||
cd build_release
|
||||
cmake --build . --target hermesc --config Release
|
||||
if (-not $?) { throw "Failed to build Hermes" }
|
||||
|
||||
echo "Copying hermesc.exe to win64-bin"
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
|
||||
# Include Windows runtime dependencies
|
||||
Copy-Item -Path "deps\*" -Destination "win64-bin"
|
||||
}
|
||||
else {
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
|
||||
build_android:
|
||||
runs-on: 8-core-ubuntu
|
||||
@@ -151,53 +519,201 @@ jobs:
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Android
|
||||
uses: ./.github/actions/build-android
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Set React Native Version
|
||||
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
- name: Build and publish all the Android Artifacts to /tmp/maven-local
|
||||
run: |
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
|
||||
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
|
||||
fi
|
||||
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
path: |
|
||||
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
|
||||
packages/react-native-gradle-plugin/settings-plugin/build/reports
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
compression-level: 0
|
||||
|
||||
build_npm_package:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs:
|
||||
[
|
||||
set_release_type,
|
||||
prepare_hermes_workspace,
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
]
|
||||
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
|
||||
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
|
||||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
|
||||
# Repeated here, as the environment key in this executor will overwrite the one in defaults
|
||||
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
|
||||
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build and Publish NPM Package
|
||||
uses: ./.github/actions/build-npm-package
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Create /tmp/hermes/osx-bin directory
|
||||
run: mkdir -p /tmp/hermes/osx-bin
|
||||
- name: Download osx-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-darwin-bin-Release
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download darwin-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-darwin-bin-Debug
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download hermes dSYM debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-dSYM-Debug
|
||||
path: /tmp/hermes/dSYM/Debug
|
||||
- name: Download hermes dSYM release vartifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-dSYM-Release
|
||||
path: /tmp/hermes/dSYM/Release
|
||||
- name: Download windows-bin artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: /tmp/hermes/win64-bin
|
||||
- name: Download linux-bin artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Show /tmp/hermes directory
|
||||
run: ls -lR /tmp/hermes
|
||||
- name: Copy Hermes binaries
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
|
||||
|
||||
# When build_hermes_macos runs as a matrix, it outputs
|
||||
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
|
||||
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
|
||||
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
else
|
||||
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
|
||||
echo "Could not locate macOS hermesc binary."; exit 1;
|
||||
fi
|
||||
|
||||
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
|
||||
fi
|
||||
|
||||
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
|
||||
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
|
||||
|
||||
# Make sure the hermesc files are actually executable.
|
||||
chmod -R +x packages/react-native/sdks/hermesc/*
|
||||
|
||||
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
|
||||
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
|
||||
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
# Continue with publish steps
|
||||
- name: Set npm credentials
|
||||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.GHA_NPM_TOKEN }}" > ~/.npmrc
|
||||
- name: Publish NPM
|
||||
run: |
|
||||
git config --global --add safe.directory /__w/react-native/react-native
|
||||
echo "GRADLE_OPTS = $GRADLE_OPTS"
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
|
||||
node ./scripts/releases-ci/publish-npm.js -t nightly
|
||||
- name: Zip Maven Artifacts from /tmp/maven-local
|
||||
working-directory: /tmp
|
||||
run: zip -r maven-local.zip maven-local
|
||||
- name: Upload Maven Artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: maven-local
|
||||
path: /tmp/maven-local.zip
|
||||
- name: Upload npm logs
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: npm-logs
|
||||
path: ~/.npm/_logs
|
||||
- name: Build release package as a job artifact
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
|
||||
run: |
|
||||
mkdir -p build
|
||||
|
||||
FILENAME=$(cd packages/react-native; npm pack | tail -1)
|
||||
mv packages/react-native/$FILENAME build/
|
||||
|
||||
echo $FILENAME > build/react-native-package-version
|
||||
- name: Upload release package
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
|
||||
with:
|
||||
name: react-native-package
|
||||
path: build
|
||||
- name: Update rn-diff-purge to generate upgrade-support diff
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
run: |
|
||||
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
|
||||
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
|
||||
|
||||
@@ -21,7 +21,6 @@ jobs:
|
||||
- name: Verify RN version
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const verifyVersion = require('./.github/workflow-scripts/verifyVersion.js')
|
||||
const labelWithContext = await verifyVersion(github, context);
|
||||
@@ -41,7 +40,6 @@ jobs:
|
||||
- name: Add descriptive label
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const addDescriptiveLabel = require('./.github/workflow-scripts/addDescriptiveLabels.js')
|
||||
await addDescriptiveLabel(github, context);
|
||||
@@ -54,7 +52,6 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const actOnLabel = require('./.github/workflow-scripts/actOnLabel.js')
|
||||
await actOnLabel(github, context, {label: context.payload.label.name})
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
name: Prebuild iOS Dependencies
|
||||
|
||||
on:
|
||||
workflow_call: # this directive allow us to call this workflow from other workflows
|
||||
|
||||
|
||||
jobs:
|
||||
build-rn-slice:
|
||||
runs-on: macos-14
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: ['Debug', 'Release']
|
||||
slice: [
|
||||
'ios',
|
||||
'ios-simulator',
|
||||
'mac-catalyst',
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore cache if present
|
||||
id: restore-ios-slice
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: packages/react-native/
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download Hermes
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Extract Hermes
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=/tmp/hermes/hermes-runtime-darwin
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR)."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ matrix.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/third-party/
|
||||
- name: Extract ReactNativeDependencies
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
# Extract ReactNativeDependencies
|
||||
tar -xzf /tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz -C /tmp/third-party/
|
||||
|
||||
# Create destination folder
|
||||
mkdir -p packages/react-native/third-party/
|
||||
|
||||
# Move the XCFramework in the destination directory
|
||||
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
|
||||
|
||||
VERSION=$(jq -r '.version' packages/react-native/package.json)
|
||||
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
|
||||
cat "packages/react-native/third-party/version.txt"
|
||||
# Check destination directory
|
||||
ls -lR packages/react-native/third-party/
|
||||
- name: Setup the workspace
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild.js -s -f "${{ matrix.flavor }}"
|
||||
- name: Build React Native
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
# This is going to be replaced by a CLI script
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild -b -f "${{ matrix.flavor }}" -p "${{ matrix.slice }}"
|
||||
- name: Upload headers
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prebuild-ios-core-headers-${{ matrix.flavor }}-${{ matrix.slice }}
|
||||
path:
|
||||
packages/react-native/.build/headers
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: prebuild-ios-core-slice-${{ matrix.flavor }}-${{ matrix.slice }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
- name: Save Cache
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
packages/react-native/.build/headers
|
||||
|
||||
compose-xcframework:
|
||||
runs-on: macos-14
|
||||
needs: [build-rn-slice]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: ['Debug', 'Release']
|
||||
env:
|
||||
REACT_ORG_CODE_SIGNING_P12_CERT: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
|
||||
REACT_ORG_CODE_SIGNING_P12_CERT_PWD: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore cache if present
|
||||
id: restore-ios-xcframework
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/.build/output/xcframeworks
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download slice artifacts
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: prebuild-ios-core-slice-${{ matrix.flavor }}-*
|
||||
path: packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
merge-multiple: true
|
||||
- name: Download headers
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: prebuild-ios-core-headers-${{ matrix.flavor }}-*
|
||||
path: packages/react-native/.build/headers
|
||||
merge-multiple: true
|
||||
- name: Setup Keychain
|
||||
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
|
||||
uses: apple-actions/import-codesign-certs@v3 # https://github.com/marketplace/actions/import-code-signing-certificates
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
|
||||
p12-password: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
|
||||
- name: Create XCFramework
|
||||
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT == '' }}
|
||||
run: |
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild -c -f "${{ matrix.flavor }}"
|
||||
- name: Create and Sign XCFramework
|
||||
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
|
||||
run: |
|
||||
cd packages/react-native
|
||||
node scripts/ios-prebuild -c -f "${{ matrix.flavor }}" -i "React Org"
|
||||
- name: Compress and Rename XCFramework
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/react-native/.build/output/xcframeworks/${{matrix.flavor}}
|
||||
tar -cz -f ../ReactCore${{matrix.flavor}}.xcframework.tar.gz React.xcframework
|
||||
- name: Compress and Rename dSYM
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/react-native/.build/output/xcframeworks/${{matrix.flavor}}/Symbols
|
||||
tar -cz -f ../../ReactCore${{ matrix.flavor }}.framework.dSYM.tar.gz .
|
||||
- name: Upload XCFramework Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
- name: Upload dSYM Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
path: packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
- name: Save cache if present
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
@@ -1,202 +0,0 @@
|
||||
name: Prebuild iOS Dependencies
|
||||
|
||||
on:
|
||||
workflow_call: # this directive allow us to call this workflow from other workflows
|
||||
|
||||
|
||||
jobs:
|
||||
prepare_workspace:
|
||||
name: Prepare workspace
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Restore cache if present
|
||||
id: restore-ios-prebuilds
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/third-party/
|
||||
key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Prepare Dependencies
|
||||
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
node scripts/releases/prepare-ios-prebuilds.js -s
|
||||
- name: Generate Package.swift
|
||||
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
node scripts/releases/prepare-ios-prebuilds.js -w
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: ios-prebuilds-workspace
|
||||
path: packages/react-native/third-party/
|
||||
- name: Save Cache
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
enableCrossOsArchive: true
|
||||
path: packages/react-native/third-party/
|
||||
|
||||
build-apple-slices:
|
||||
name: Build Apple Slice
|
||||
runs-on: macos-14
|
||||
needs: [prepare_workspace]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: ['Debug', 'Release']
|
||||
slice: ['ios',
|
||||
'ios-simulator',
|
||||
'macos',
|
||||
'mac-catalyst',
|
||||
'tvos',
|
||||
'tvos-simulator',
|
||||
'xros',
|
||||
'xros-simulator']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.1'
|
||||
- name: Restore slice folder
|
||||
id: restore-slice-folder
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/third-party/.build/Build/Products
|
||||
key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
- name: Yarn Install
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Restore workspace
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ios-prebuilds-workspace
|
||||
path: packages/react-native/third-party/
|
||||
- name: Print third-party folder structure
|
||||
run: ls -lR packages/react-native/third-party
|
||||
- name: Install VisionOS
|
||||
if: ${{ steps.restore-slice-folder.outputs.cache-hit != 'true' && (matrix.slice == 'xros' || matrix.slice == 'xros-simulator') }}
|
||||
run: |
|
||||
# https://github.com/actions/runner-images/issues/10559
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
sudo xcrun simctl list
|
||||
sudo xcodebuild -downloadPlatform visionOS
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
- name: Build slice ${{ matrix.slice }} for ${{ matrix.flavor }}
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
run: node scripts/releases/prepare-ios-prebuilds.js -b -p ${{ matrix.slice }} -r ${{ matrix.flavor }}
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: prebuild-slice-${{ matrix.flavor }}-${{ matrix.slice }}
|
||||
path: |
|
||||
packages/react-native/third-party/.build/Build/Products
|
||||
- name: Save Cache
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
enableCrossOsArchive: true
|
||||
path: |
|
||||
packages/react-native/third-party/.build/Build/Products
|
||||
|
||||
create-xcframework:
|
||||
name: Prepare XCFramework
|
||||
runs-on: macos-14
|
||||
needs: [build-apple-slices]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
env:
|
||||
REACT_ORG_CODE_SIGNING_P12_CERT: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
|
||||
REACT_ORG_CODE_SIGNING_P12_CERT_PWD: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.1'
|
||||
- name: Restore XCFramework
|
||||
id: restore-xcframework
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
packages/react-native/third-party/
|
||||
key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
# If cache hit, we already have our binary. We don't need to do anything.
|
||||
- name: Yarn Install
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Restore workspace
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ios-prebuilds-workspace
|
||||
path: packages/react-native/third-party/
|
||||
- name: Download slices
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: prebuild-slice-${{ matrix.flavor }}-*
|
||||
path: packages/react-native/third-party/.build/Build/Products
|
||||
merge-multiple: true
|
||||
- name: Setup Keychain
|
||||
if: ${{ steps.restore-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
|
||||
uses: apple-actions/import-codesign-certs@v3 # https://github.com/marketplace/actions/import-code-signing-certificates
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
|
||||
p12-password: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
|
||||
- name: Create XCFramework
|
||||
if: ${{ steps.restore-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT == '' }}
|
||||
run: node scripts/releases/prepare-ios-prebuilds.js -c
|
||||
- name: Create and Sign XCFramework
|
||||
if: ${{ steps.restore-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
|
||||
run: node scripts/releases/prepare-ios-prebuilds.js -c -i "React Org"
|
||||
- name: Compress and Rename XCFramework
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
tar -cz -f packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz \
|
||||
packages/react-native/third-party/ReactNativeDependencies.xcframework
|
||||
- name: Show Symbol folder content
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
run: ls -lR packages/react-native/third-party/Symbols
|
||||
- name: Compress and Rename dSYM
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
|
||||
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
|
||||
- name: Upload XCFramework Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
- name: Upload dSYM Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
path: |
|
||||
packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
- name: Save XCFramework in Cache
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
@@ -13,15 +13,13 @@ jobs:
|
||||
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run Yarn Install
|
||||
uses: ./.github/actions/yarn-install
|
||||
run: yarn install
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
- name: Build types
|
||||
run: yarn build-types --skip-snapshot
|
||||
- name: Set NPM auth token
|
||||
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
|
||||
- name: Find and publish all bumped packages
|
||||
|
||||
@@ -2,8 +2,8 @@ name: Publish Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v0.*.*" # This should match v0.X.Y
|
||||
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
|
||||
- "v0.*.*" # This should match v0.X.Y
|
||||
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
|
||||
jobs:
|
||||
set_release_type:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -24,32 +24,55 @@ jobs:
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
BUILD_FROM_SOURCE: true
|
||||
outputs:
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
|
||||
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
|
||||
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
|
||||
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-14
|
||||
runs-on: macos-13
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Build HermesC Apple
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
needs: [build_hermesc_apple, prepare_hermes_workspace]
|
||||
@@ -57,27 +80,104 @@ jobs:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "15.1"
|
||||
IOS_DEPLOYMENT_TARGET: "13.4"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
|
||||
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
slice: ${{ matrix.slice}}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
SLICE=${{ matrix.slice }}
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
|
||||
echo "Final path for this slice is: $FINAL_PATH"
|
||||
|
||||
if [[ -d "$FINAL_PATH" ]]; then
|
||||
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$ARTIFACTS_EXIST" ]]; then
|
||||
echo "[HERMES] Skipping! Artifacts exists already."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
echo "Moving from build_$SLICE to $FINAL_PATH"
|
||||
mv build_"$SLICE" "$FINAL_PATH"
|
||||
|
||||
# check whether everything is there
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
|
||||
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
|
||||
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz
|
||||
- name: Save slice cache
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-14
|
||||
runs-on: macos-13
|
||||
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
@@ -89,22 +189,192 @@ jobs:
|
||||
flavor: [Debug, Release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Hermes MacOS
|
||||
uses: ./.github/actions/build-hermes-macos
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
run: |
|
||||
FLAVOR="${{ matrix.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
secrets: inherit
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: yarn install --non-interactive
|
||||
- name: Slice cache macosx
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
|
||||
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
mv build_macosx_${{ matrix.flavor }} build_macosx
|
||||
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
|
||||
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
|
||||
mv build_catalyst_${{ matrix.flavor }} build_catalyst
|
||||
mv build_xros_${{ matrix.flavor }} build_xros
|
||||
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
BUILD_TYPE="${{ matrix.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
|
||||
--inputDir ./packages/react-native/sdks/hermes \
|
||||
--buildType "$BUILD_TYPE" \
|
||||
--outputDir $TARBALL_OUTPUT_DIR)
|
||||
|
||||
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
|
||||
|
||||
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
|
||||
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
|
||||
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
FLAVOR=${{ matrix.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
|
||||
mkdir -p "$WORKING_DIR/macosx"
|
||||
mkdir -p "$WORKING_DIR/catalyst"
|
||||
mkdir -p "$WORKING_DIR/iphoneos"
|
||||
mkdir -p "$WORKING_DIR/iphonesimulator"
|
||||
mkdir -p "$WORKING_DIR/xros"
|
||||
mkdir -p "$WORKING_DIR/xrsimulator"
|
||||
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
|
||||
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
|
||||
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
|
||||
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
|
||||
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
|
||||
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
|
||||
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
|
||||
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
|
||||
|
||||
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
|
||||
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
|
||||
|
||||
mkdir -p "$DEST_DIR"
|
||||
mv "hermes.framework.dSYM" "$DEST_DIR"
|
||||
- name: Upload hermes dSYM artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-dSYM-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-osx-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -114,126 +384,382 @@ jobs:
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Linux
|
||||
uses: ./.github/actions/build-hermesc-linux
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/linux64-bin/
|
||||
/tmp/hermes/hermes/destroot/
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p /tmp/hermes/linux64-bin
|
||||
- name: Build HermesC for Linux
|
||||
run: |
|
||||
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
|
||||
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
|
||||
else
|
||||
cd /tmp/hermes
|
||||
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
|
||||
cmake --build build --target hermesc -j 4
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2019
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Windows
|
||||
uses: ./.github/actions/build-hermesc-windows
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4.0.0
|
||||
with:
|
||||
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
D:\tmp\hermes\win64-bin\
|
||||
D:\tmp\hermes\hermes\icu\
|
||||
D:\tmp\hermes\hermes\deps\
|
||||
D:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
run: |
|
||||
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
|
||||
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
|
||||
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
|
||||
- name: Build HermesC for Windows
|
||||
run: |
|
||||
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
|
||||
choco install --no-progress cmake --version 3.14.7
|
||||
if (-not $?) { throw "Failed to install CMake" }
|
||||
|
||||
build_npm_package:
|
||||
cd $Env:HERMES_WS_DIR\icu
|
||||
# If Invoke-WebRequest shows a progress bar, it will fail with
|
||||
# Win32 internal error "Access is denied" 0x5 occurred [...]
|
||||
$progressPreference = 'silentlyContinue'
|
||||
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
|
||||
Expand-Archive -Path "icu.zip" -DestinationPath "."
|
||||
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
|
||||
# Include MSVC++ 2015 redistributables
|
||||
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
|
||||
|
||||
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
|
||||
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
|
||||
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
if (-not $?) { throw "Failed to configure Hermes" }
|
||||
echo "Running windows build..."
|
||||
cd build_release
|
||||
cmake --build . --target hermesc --config Release
|
||||
if (-not $?) { throw "Failed to build Hermes" }
|
||||
|
||||
echo "Copying hermesc.exe to win64-bin"
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
|
||||
# Include Windows runtime dependencies
|
||||
Copy-Item -Path "deps\*" -Destination "win64-bin"
|
||||
}
|
||||
else {
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
|
||||
build_android:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs:
|
||||
[
|
||||
set_release_type,
|
||||
prepare_hermes_workspace,
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
]
|
||||
needs: [set_release_type]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Set React Native Version
|
||||
run: |
|
||||
git config --global --add safe.directory /__w/react-native/react-native
|
||||
node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
- name: Build and publish all the Android Artifacts to /tmp/maven-local
|
||||
run: |
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
|
||||
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
|
||||
fi
|
||||
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
path: |
|
||||
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
|
||||
packages/react-native-gradle-plugin/settings-plugin/build/reports
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
compression-level: 0
|
||||
|
||||
build_npm_package:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
|
||||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
|
||||
# Repeated here, as the environment key in this executor will overwrite the one in defaults
|
||||
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
|
||||
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Build and Publish NPM Package
|
||||
uses: ./.github/actions/build-npm-package
|
||||
- name: Create /tmp/hermes/osx-bin directory
|
||||
run: mkdir -p /tmp/hermes/osx-bin
|
||||
- name: Download osx-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-darwin-bin-Release
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download darwin-bin debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-darwin-bin-Debug
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download hermes dSYM debug artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-dSYM-Debug
|
||||
path: /tmp/hermes/dSYM/Debug
|
||||
- name: Download hermes dSYM release vartifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-dSYM-Release
|
||||
path: /tmp/hermes/dSYM/Release
|
||||
- name: Download windows-bin artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: /tmp/hermes/win64-bin
|
||||
- name: Download linux-bin artifacts
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
- name: Cache setup
|
||||
id: cache_setup
|
||||
uses: ./.github/actions/cache_setup
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
- name: Show /tmp/hermes directory
|
||||
run: ls -lR /tmp/hermes
|
||||
- name: Copy Hermes binaries
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
|
||||
|
||||
# When build_hermes_macos runs as a matrix, it outputs
|
||||
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
|
||||
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
|
||||
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
else
|
||||
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
|
||||
echo "Could not locate macOS hermesc binary."; exit 1;
|
||||
fi
|
||||
|
||||
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
|
||||
fi
|
||||
|
||||
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
|
||||
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
|
||||
|
||||
# Make sure the hermesc files are actually executable.
|
||||
chmod -R +x packages/react-native/sdks/hermesc/*
|
||||
|
||||
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
|
||||
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
|
||||
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
run: yarn install --non-interactive
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
# Continue with publish steps
|
||||
- name: Set npm credentials
|
||||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.GHA_NPM_TOKEN }}" > ~/.npmrc
|
||||
- name: Publish NPM
|
||||
run: |
|
||||
git config --global --add safe.directory /__w/react-native/react-native
|
||||
echo "GRADLE_OPTS = $GRADLE_OPTS"
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
|
||||
node ./scripts/releases-ci/publish-npm.js -t release
|
||||
- name: Zip Maven Artifacts from /tmp/maven-local
|
||||
working-directory: /tmp
|
||||
run: zip -r maven-local.zip maven-local
|
||||
- name: Upload Maven Artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: maven-local
|
||||
path: /tmp/maven-local.zip
|
||||
- name: Upload npm logs
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: npm-logs
|
||||
path: ~/.npm/_logs
|
||||
- name: Build release package as a job artifact
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
|
||||
run: |
|
||||
mkdir -p build
|
||||
|
||||
FILENAME=$(cd packages/react-native; npm pack | tail -1)
|
||||
mv packages/react-native/$FILENAME build/
|
||||
|
||||
echo $FILENAME > build/react-native-package-version
|
||||
- name: Upload release package
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
|
||||
with:
|
||||
name: react-native-package
|
||||
path: build
|
||||
- name: Publish @react-native-community/template
|
||||
id: publish-template-to-npm
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {publishTemplate} = require('./.github/workflow-scripts/publishTemplate.js')
|
||||
const version = "${{ github.ref_name }}"
|
||||
const isDryRun = false
|
||||
await publishTemplate(github, version, isDryRun);
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
shell: bash
|
||||
id: publish-to-npm
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -n1 --pretty=%B);
|
||||
if grep -q '#publish-packages-to-npm&latest' <<< "$COMMIT_MSG"; then
|
||||
echo "TAG=latest" >> $GITHUB_OUTPUT
|
||||
IS_LATEST=true
|
||||
else
|
||||
IS_LATEST=false
|
||||
fi
|
||||
# Go from v0.75.0-rc.4 -> 0.75-stable, which is the template's branching scheme
|
||||
VERSION=$(grep -oE '\d+\.\d+' <<< "${{ github.ref_name }}" | { read version; echo "$version-stable"; })
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
curl -L https://api.github.com/repos/react-native-community/template/actions/workflows/release.yaml/dispatches
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
|
||||
-d "{\"ref\":\"$VERSION\",\"inputs\":{\"version\":\"${{ github.ref_name }}\",\"is_latest_on_npm\":\"$IS_LATEST\"}}"
|
||||
- name: Wait for template to be published
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
timeout-minutes: 3
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {verifyPublishedTemplate, isLatest} = require('./.github/workflow-scripts/publishTemplate.js')
|
||||
const version = "${{ github.ref_name }}"
|
||||
await verifyPublishedTemplate(version, isLatest());
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: ${{ steps.publish-to-npm.outputs.VERSION }}
|
||||
TAG: ${{ steps.publish-to-npm.outputs.TAG }}
|
||||
run: |
|
||||
echo "Waiting until @react-native-community/template is published to npm"
|
||||
while true; do
|
||||
if curl -o /dev/null -s -f "https://registry.npmjs.org/@react-native-community/template/$VERSION"; then
|
||||
echo "Confirm that @react-native-community/template@$VERSION is published on npm"
|
||||
break
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
while [ "$TAG" == "latest" ]; do
|
||||
CURRENT=$(curl -s "https://registry.npmjs.org/react-native/latest" | jq -r '.version');
|
||||
if [ "$CURRENT" == "$VERSION" ]; then
|
||||
echo "Confirm that @react-native-community/template@latest == $VERSION on npm"
|
||||
break
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
- name: Update rn-diff-purge to generate upgrade-support diff
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
run: |
|
||||
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
|
||||
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
|
||||
- name: Verify Release is on NPM
|
||||
timeout-minutes: 3
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {verifyReleaseOnNpm} = require('./.github/workflow-scripts/verifyReleaseOnNpm.js');
|
||||
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
const version = "${{ github.ref_name }}";
|
||||
await verifyReleaseOnNpm(version, isLatest());
|
||||
- name: Verify that artifacts are on Maven
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {verifyArtifactsAreOnMaven} = require('./.github/workflow-scripts/verifyArtifactsAreOnMaven.js');
|
||||
const version = "${{ github.ref_name }}";
|
||||
await verifyArtifactsAreOnMaven(version);
|
||||
|
||||
generate_changelog:
|
||||
needs: build_npm_package
|
||||
uses: ./.github/workflows/generate-changelog.yml
|
||||
secrets: inherit
|
||||
|
||||
bump_podfile_lock:
|
||||
needs: build_npm_package
|
||||
uses: ./.github/workflows/bump-podfile-lock.yml
|
||||
secrets: inherit
|
||||
|
||||
create_draft_release:
|
||||
needs: generate_changelog
|
||||
uses: ./.github/workflows/create-draft-release.yml
|
||||
secrets: inherit
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
name: Retry workflow
|
||||
# Based on https://stackoverflow.com/a/78314483
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_id:
|
||||
required: true
|
||||
jobs:
|
||||
rerun:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: rerun ${{ inputs.run_id }}
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
|
||||
gh run rerun ${{ inputs.run_id }} --failed
|
||||
@@ -0,0 +1,26 @@
|
||||
name: Run E2E Tests
|
||||
# This workflow is used to trigger E2E tests on a PR when a comment is made
|
||||
# containing the text "#run-e2e-tests".
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
rebase:
|
||||
name: Trigger E2E Tests
|
||||
permissions:
|
||||
contents: write # for cirrus-actions/rebase to push code to rebase
|
||||
pull-requests: read # for cirrus-actions/rebase to get info about PR
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '#run-e2e-tests')
|
||||
steps:
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
|
||||
- name: Push empty commit
|
||||
run: |
|
||||
git commit -m "#run-e2e-tests" --allow-empty
|
||||
git push origin $(git branch --show-current)
|
||||
@@ -12,10 +12,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 180
|
||||
stale-issue-message: 'This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
|
||||
stale-pr-message: 'This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
|
||||
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
|
||||
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.'
|
||||
exempt-issue-labels: 'Help Wanted :octocat:, Good first issue, Never gets stale, Issue: Author Provided Repro'
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
ascending: true
|
||||
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 180
|
||||
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
any-of-labels: 'Needs: Author Feedback'
|
||||
days-before-stale: 24
|
||||
stale-issue-message: "This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days."
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
ascending: true
|
||||
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
any-of-labels: 'Needs: Author Feedback'
|
||||
days-before-stale: 24
|
||||
stale-issue-message: "This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days."
|
||||
|
||||
+689
-399
File diff suppressed because it is too large
Load Diff
@@ -1,100 +0,0 @@
|
||||
name: Test Libraries on Nightlies
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
discord_webhook_url:
|
||||
required: true
|
||||
|
||||
|
||||
# We use the matrix.library entry to specify the dependency we want to use
|
||||
# The key is used directly as the <pkg> in the `yarn add <pkg>` command.
|
||||
jobs:
|
||||
runner-setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
runners: '{"ios":"macos-14-large", "android": "ubuntu-latest"}'
|
||||
steps:
|
||||
- run: echo no-op
|
||||
|
||||
test-library-on-nightly:
|
||||
name: "[${{ matrix.platform }}] ${{ matrix.library }}"
|
||||
needs: runner-setup
|
||||
runs-on: ${{ fromJSON(needs.runner-setup.outputs.runners)[matrix.platform] }}
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
library: [
|
||||
"react-native-async-storage",
|
||||
"react-native-blob-util",
|
||||
"@react-native-clipboard/clipboard",
|
||||
"@react-native-community/datetimepicker",
|
||||
"react-native-gesture-handler",
|
||||
"react-native-image-picker",
|
||||
"react-native-linear-gradient",
|
||||
"@react-native-masked-view/masked-view",
|
||||
# "react-native-maps", React Native Maps with the New Arch support has a complex cocoapods setup for iOS. It needs a dedicated workflow.
|
||||
"@react-native-community/netinfo",
|
||||
"react-native-reanimated@nightly react-native-worklets@nightly", #reanimated requires worklet to be explicitly installed as a separate package
|
||||
"react-native-svg",
|
||||
"react-native-video",
|
||||
"react-native-webview",
|
||||
"react-native-mmkv",
|
||||
"react-native-screens",
|
||||
"react-native-pager-view",
|
||||
"@react-native-community/slider",
|
||||
# additional OSS libs used internally
|
||||
"scandit-react-native-datacapture-barcode scandit-react-native-datacapture-core",
|
||||
"react-native-contacts",
|
||||
"react-native-device-info",
|
||||
"react-native-email-link",
|
||||
"@dr.pogodin/react-native-fs",
|
||||
"react-native-permissions",
|
||||
"react-native-vector-icons",
|
||||
"react-native-masked-view",
|
||||
"@react-native-community/image-editor",
|
||||
]
|
||||
platform: [ios, android]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Test ${{ matrix.library }}
|
||||
id: run-test
|
||||
uses: ./.github/actions/test-library-on-nightly
|
||||
with:
|
||||
library-npm-package: ${{ matrix.library }}
|
||||
platform: ${{ matrix.platform}}
|
||||
- name: Save outcome
|
||||
id: save-outcome
|
||||
if: always()
|
||||
run: |
|
||||
LIB_FOLDER=$(echo "${{matrix.library}}" | tr ' ' '_' | tr '/' '_')
|
||||
echo "${{matrix.library}}: ${{steps.run-test.outcome}}" > "/tmp/$LIB_FOLDER-${{ matrix.platform }}-outcome"
|
||||
echo "lib_folder=$LIB_FOLDER" >> $GITHUB_OUTPUT
|
||||
- name: Upload Artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.save-outcome.outputs.lib_folder }}-${{ matrix.platform }}-outcome
|
||||
path: /tmp/${{ steps.save-outcome.outputs.lib_folder }}-${{ matrix.platform }}-outcome
|
||||
|
||||
|
||||
collect-results:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-library-on-nightly]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore outcomes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: '*-outcome'
|
||||
path: /tmp
|
||||
- name: Collect failures
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {collectResults} = require('./.github/workflow-scripts/collectNightlyOutcomes.js');
|
||||
await collectResults('${{secrets.discord_webhook_url}}');
|
||||
+20
-33
@@ -30,7 +30,6 @@ project.xcworkspace
|
||||
/packages/rn-tester/android/app/gradle/
|
||||
/packages/rn-tester/android/app/gradlew
|
||||
/packages/rn-tester/android/app/gradlew.bat
|
||||
/packages/react-native/build/
|
||||
/packages/react-native/ReactAndroid/build/
|
||||
/packages/react-native/ReactAndroid/.cxx/
|
||||
/packages/react-native/ReactAndroid/gradle/
|
||||
@@ -40,8 +39,10 @@ project.xcworkspace
|
||||
/packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
/packages/react-native/ReactAndroid/hermes-engine/build/
|
||||
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
|
||||
/private/helloworld/android/app/build/
|
||||
/private/helloworld/android/build/
|
||||
/packages/react-native/template/android/app/build/
|
||||
/packages/react-native/template/android/build/
|
||||
/packages/helloworld/android/app/build/
|
||||
/packages/helloworld/android/build/
|
||||
/packages/react-native-popup-menu-android/android/build/
|
||||
/packages/react-native-test-library/android/build/
|
||||
|
||||
@@ -69,7 +70,6 @@ local.properties
|
||||
*.iml
|
||||
/packages/react-native/android/*
|
||||
!/packages/react-native/android/README.md
|
||||
.kotlin/
|
||||
|
||||
# Node
|
||||
node_modules
|
||||
@@ -108,42 +108,37 @@ package-lock.json
|
||||
|
||||
# Ruby Gems (Bundler)
|
||||
/packages/react-native/vendor
|
||||
/private/helloworld/vendor
|
||||
/packages/react-native/template/vendor
|
||||
/packages/helloworld/vendor
|
||||
.ruby-version
|
||||
/**/.ruby-version
|
||||
vendor/
|
||||
|
||||
# iOS / CocoaPods
|
||||
/private/helloworld/ios/build/
|
||||
/private/helloworld/ios/Pods/
|
||||
/private/helloworld/ios/Podfile.lock
|
||||
/packages/rn-tester/bin/
|
||||
/packages/rn-tester/cache/
|
||||
/packages/rn-tester/extensions/
|
||||
/packages/rn-tester/gems/
|
||||
/packages/rn-tester/specifications/
|
||||
/packages/react-native/template/ios/build/
|
||||
/packages/react-native/template/ios/Pods/
|
||||
/packages/react-native/template/ios/Podfile.lock
|
||||
/packages/helloworld/ios/build/
|
||||
/packages/helloworld/ios/Pods/
|
||||
/packages/helloworld/ios/Podfile.lock
|
||||
/packages/rn-tester/Gemfile.lock
|
||||
/packages/**/RCTLegacyInteropComponents.mm
|
||||
/packages/sourcemap.ios.map
|
||||
|
||||
# Ignore RNTester specific Pods, but keep the __offline_mirrors__ here.
|
||||
/packages/rn-tester/Pods/*
|
||||
!/packages/rn-tester/Pods/__offline_mirrors_hermes__
|
||||
!/packages/rn-tester/Pods/__offline_mirrors_jsc__
|
||||
|
||||
# Swift Package build folder
|
||||
/packages/react-native/.build
|
||||
/packages/react-native/.swiftpm
|
||||
|
||||
# @react-native/codegen
|
||||
/packages/react-native/React/FBReactNativeSpec/
|
||||
/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec
|
||||
/packages/react-native-codegen/lib
|
||||
/packages/react-native-codegen/tmp/
|
||||
/packages/react-native/ReactCommon/react/renderer/components/rncore/
|
||||
/packages/rn-tester/NativeModuleExample/ScreenshotManagerSpec*
|
||||
/**/RCTThirdPartyFabricComponentsProvider.*
|
||||
|
||||
# @react-native/codegen-typescript-test
|
||||
/private/react-native-codegen-typescript-test/lib
|
||||
/packages/react-native-codegen-typescript-test/lib
|
||||
|
||||
# Additional SDKs
|
||||
/packages/react-native/sdks/download
|
||||
@@ -151,11 +146,6 @@ vendor/
|
||||
/packages/react-native/sdks/hermesc
|
||||
/packages/react-native/sdks/hermes-engine/hermes-engine-from-local-source-dir.tar.gz
|
||||
|
||||
# iOS prebuilds
|
||||
/packages/react-native/third-party/
|
||||
fix_*.patch
|
||||
*.xcframework
|
||||
|
||||
# Visual Studio Code (config dir - if present, this merges user defined
|
||||
# workspace settings on top of react-native.code-workspace)
|
||||
/.vscode
|
||||
@@ -169,12 +159,9 @@ fix_*.patch
|
||||
# Temporary files created by Metro to check the health of the file watcher
|
||||
.metro-health-check*
|
||||
|
||||
# Jest Integration
|
||||
/private/react-native-fantom/build/
|
||||
/private/react-native-fantom/tester/build/
|
||||
# E2E files
|
||||
/packages/rn-tester-e2e/apps/*.apk
|
||||
/packages/rn-tester-e2e/apps/*.app
|
||||
|
||||
# [Experimental] Generated TS type definitions
|
||||
/packages/**/types_generated/
|
||||
|
||||
/packages/debugger-shell/build/
|
||||
/packages/*/dist/
|
||||
# CircleCI
|
||||
.circleci/generated_config.yml
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user