diff --git a/.github/actions/build-apple-slices-hermes/action.yml b/.github/actions/build-apple-slices-hermes/action.yml deleted file mode 100644 index bc66de6a21b..00000000000 --- a/.github/actions/build-apple-slices-hermes/action.yml +++ /dev/null @@ -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/lib/hermesvm.framework" ]]; then - echo "Successfully built hermesvm.framework for $SLICE in $FLAVOR" - else - echo "Failed to built hermesvm.framework for $SLICE in $FLAVOR" - exit 1 - fi - - if [[ -d "$FINAL_PATH/lib/hermesvm.framework.dSYM" ]]; then - echo "Successfully built hermesvm.framework.dSYM for $SLICE in $FLAVOR" - else - echo "Failed to built hermesvm.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 }} diff --git a/.github/actions/build-hermes-macos/action.yml b/.github/actions/build-hermes-macos/action.yml deleted file mode 100644 index 0f3a42a367f..00000000000 --- a/.github/actions/build-hermes-macos/action.yml +++ /dev/null @@ -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: 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: Setup node.js - uses: ./.github/actions/setup-node - - 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=lib/hermesvm.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 "hermesvm.framework.dSYM" . - - mkdir -p "$DEST_DIR" - mv "hermesvm.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 diff --git a/.github/actions/build-hermesc-apple/action.yml b/.github/actions/build-hermesc-apple/action.yml deleted file mode 100644 index c4fefdce9e1..00000000000 --- a/.github/actions/build-hermesc-apple/action.yml +++ /dev/null @@ -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 diff --git a/.github/actions/build-hermesc-linux/action.yml b/.github/actions/build-hermesc-linux/action.yml deleted file mode 100644 index 0c90739d0a7..00000000000 --- a/.github/actions/build-hermesc-linux/action.yml +++ /dev/null @@ -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 diff --git a/.github/actions/build-hermesc-windows/action.yml b/.github/actions/build-hermesc-windows/action.yml deleted file mode 100644 index 1dcaebb2fb9..00000000000 --- a/.github/actions/build-hermesc-windows/action.yml +++ /dev/null @@ -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\ diff --git a/.github/actions/build-npm-package/action.yml b/.github/actions/build-npm-package/action.yml index 8b894e90639..808916f8b29 100644 --- a/.github/actions/build-npm-package/action.yml +++ b/.github/actions/build-npm-package/action.yml @@ -4,9 +4,6 @@ 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 @@ -20,87 +17,6 @@ runs: - 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/hermesvm.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz - cp ${{ inputs.hermes-ws-dir }}/dSYM/Release/hermesvm.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz - name: Download ReactNativeDependencies uses: actions/download-artifact@v4 with: diff --git a/.github/actions/prepare-hermes-workspace/action.yml b/.github/actions/prepare-hermes-workspace/action.yml deleted file mode 100644 index 47953b67600..00000000000 --- a/.github/actions/prepare-hermes-workspace/action.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: prepare-hermes-workspace -description: This action prepares the hermes workspace with the right hermes and react-native versions. -inputs: - hermes-ws-dir: - required: true - description: The hermes dir we need to use to setup the workspace - hermes-version-file: - required: true - description: the path to the file that will contain the hermes version -outputs: - hermes-version: - description: the version of Hermes tied to this run - value: ${{ steps.hermes-version.outputs.VERSION }} - react-native-version: - description: the version of React Native tied to this run - value: ${{ steps.react-native-version.outputs.VERSION }} -runs: - using: composite - steps: - - name: Setup hermes version - shell: bash - id: hermes-version - run: | - mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes" - - if [ -f "${{ inputs.hermes-version-file }}" ]; then - echo "Hermes Version file found! Using this version for the build:" - echo "VERSION=$(cat ${{ inputs.hermes-version-file }})" >> "$GITHUB_OUTPUT" - 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 "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT" - fi - echo "Hermes commit is $HERMES_TAG_SHA" - - - name: Get react-native version - shell: bash - id: react-native-version - run: | - VERSION=$(cat packages/react-native/package.json | jq -r '.version') - # Save the react native version we are building in an output variable so we can use that file as part of the cache key. - echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" - echo "React Native Version is $VERSION" - - - name: Cache hermes workspace - id: restore-hermes - uses: actions/cache/restore@v4 - with: - path: | - /tmp/hermes/download/ - /tmp/hermes/hermes/ - key: v1-hermes-${{ steps.hermes-version.outputs.version }} - enableCrossOsArchive: true - - # It happened while testing that a cache was created from the right folders - # but those folders where empty. Thus, the next check ensures that we can work with those caches. - - name: Check if cache was meaningful - id: meaningful-cache - shell: bash - run: | - if [[ -d /tmp/hermes/hermes ]] && [[ -n "$(ls -A /tmp/hermes/hermes)" ]]; then - echo "Found a good hermes cache" - echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT" - fi - - - name: Setup node.js - uses: ./.github/actions/setup-node - - name: Yarn- Install Dependencies - if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }} - uses: ./.github/actions/yarn-install - - - 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/. - - echo ${{ steps.hermes-version.outputs.version }} - - - name: Upload Hermes artifact - uses: actions/upload-artifact@v4.3.4 - with: - name: hermes-workspace - path: | - /tmp/hermes/download/ - /tmp/hermes/hermes/ - - - name: Cache hermes workspace - uses: actions/cache/save@v4 - if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode. - with: - path: | - /tmp/hermes/download/ - /tmp/hermes/hermes/ - key: v1-hermes-${{ steps.hermes-version.outputs.version }} - enableCrossOsArchive: true diff --git a/.github/actions/restore-hermes-workspace/action.yml b/.github/actions/restore-hermes-workspace/action.yml deleted file mode 100644 index 0b1cb259435..00000000000 --- a/.github/actions/restore-hermes-workspace/action.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: restore-hermes-workspace -description: "Restore hermes workspace that has been created in Prepare Hermes Workspace" -runs: - using: composite - steps: - - name: Download Previous Artifacts - uses: actions/download-artifact@v4 - with: - name: hermes-workspace - path: /tmp/hermes - - name: Set up workspace - shell: bash - run: | - 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/. diff --git a/.github/actions/test-ios-helloworld/action.yml b/.github/actions/test-ios-helloworld/action.yml index 39e6f3881f1..0f946101335 100644 --- a/.github/actions/test-ios-helloworld/action.yml +++ b/.github/actions/test-ios-helloworld/action.yml @@ -10,12 +10,6 @@ inputs: 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: diff --git a/.github/actions/test-ios-rntester/action.yml b/.github/actions/test-ios-rntester/action.yml index 1465dac90b5..918504c6df0 100644 --- a/.github/actions/test-ios-rntester/action.yml +++ b/.github/actions/test-ios-rntester/action.yml @@ -13,12 +13,6 @@ inputs: 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 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f4fe714006f..d68904e7648 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,86 +21,6 @@ jobs: echo "Setting release type to nightly" echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT - prepare_hermes_workspace: - runs-on: ubuntu-latest - if: github.repository == 'facebook/react-native' - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion - 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 - - 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 }} - - build_hermesc_apple: - runs-on: macos-14 - needs: prepare_hermes_workspace - env: - HERMES_WS_DIR: /tmp/hermes - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build HermesC Apple - uses: ./.github/actions/build-hermesc-apple - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - - build_apple_slices_hermes: - runs-on: macos-14 - needs: [build_hermesc_apple, prepare_hermes_workspace] - env: - 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" - XROS_DEPLOYMENT_TARGET: "1.0" - MAC_DEPLOYMENT_TARGET: "10.15" - strategy: - fail-fast: false - matrix: - flavor: [Debug, Release] - slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Slice - uses: ./.github/actions/build-apple-slices-hermes - 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 }} - - build_hermes_macos: - runs-on: macos-14 - needs: [build_apple_slices_hermes, prepare_hermes_workspace] - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin - continue-on-error: true - strategy: - fail-fast: false - matrix: - flavor: [Debug, Release] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Hermes MacOS - uses: ./.github/actions/build-hermes-macos - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - flavor: ${{ matrix.flavor }} - prebuild_apple_dependencies: if: github.repository == 'facebook/react-native' uses: ./.github/workflows/prebuild-ios-dependencies.yml @@ -111,41 +31,7 @@ jobs: with: use-hermes-nightly: true secrets: inherit - needs: [prebuild_apple_dependencies, build_hermes_macos] - - build_hermesc_linux: - runs-on: ubuntu-latest - 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 Linux - uses: ./.github/actions/build-hermesc-linux - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - - build_hermesc_windows: - runs-on: windows-2025 - 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' - 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 - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + needs: [prebuild_apple_dependencies] build_android: runs-on: 8-core-ubuntu @@ -174,10 +60,7 @@ jobs: needs: [ set_release_type, - prepare_hermes_workspace, - build_hermes_macos, - build_hermesc_linux, - build_hermesc_windows, + prepare_workspace, build_android, prebuild_apple_dependencies, prebuild_react_native_core, @@ -190,7 +73,6 @@ jobs: # By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs. ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" 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 }} @@ -202,7 +84,6 @@ jobs: - name: Build and Publish NPM Package uses: ./.github/actions/build-npm-package 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 }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index efa432f4542..6a6799db93f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -19,85 +19,6 @@ jobs: echo "Setting release type to release" echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT - prepare_hermes_workspace: - runs-on: ubuntu-latest - if: github.repository == 'facebook/react-native' - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion - 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 - - 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 }} - - build_hermesc_apple: - runs-on: macos-14 - needs: prepare_hermes_workspace - env: - HERMES_WS_DIR: /tmp/hermes - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build HermesC Apple - uses: ./.github/actions/build-hermesc-apple - with: - hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }} - build_apple_slices_hermes: - runs-on: macos-14 - needs: [build_hermesc_apple, prepare_hermes_workspace] - env: - 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" - XROS_DEPLOYMENT_TARGET: "1.0" - MAC_DEPLOYMENT_TARGET: "10.15" - strategy: - fail-fast: false - matrix: - flavor: [Debug, Release] - slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Slice - uses: ./.github/actions/build-apple-slices-hermes - 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 }} - - build_hermes_macos: - runs-on: macos-14 - needs: [build_apple_slices_hermes, prepare_hermes_workspace] - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin - continue-on-error: true - strategy: - fail-fast: false - matrix: - flavor: [Debug, Release] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Hermes MacOS - uses: ./.github/actions/build-hermes-macos - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - flavor: ${{ matrix.flavor }} - prebuild_apple_dependencies: if: github.repository == 'facebook/react-native' uses: ./.github/workflows/prebuild-ios-dependencies.yml @@ -106,51 +27,14 @@ jobs: prebuild_react_native_core: uses: ./.github/workflows/prebuild-ios-core.yml secrets: inherit - needs: [prebuild_apple_dependencies, build_hermes_macos] - - build_hermesc_linux: - runs-on: ubuntu-latest - 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 Linux - uses: ./.github/actions/build-hermesc-linux - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - - build_hermesc_windows: - runs-on: windows-2025 - 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' - 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 - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + needs: [prebuild_apple_dependencies] build_npm_package: runs-on: 8-core-ubuntu needs: [ set_release_type, - prepare_hermes_workspace, - build_hermes_macos, - build_hermesc_linux, - build_hermesc_windows, + prepare_workspace, prebuild_apple_dependencies, prebuild_react_native_core, ] @@ -162,7 +46,6 @@ jobs: # By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs. ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" 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 }} @@ -178,7 +61,6 @@ jobs: - name: Build and Publish NPM Package uses: ./.github/actions/build-npm-package 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 }} diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 59265786c01..a8c33b3b5dc 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -33,86 +33,6 @@ jobs: echo "Should I run E2E tests? ${{ inputs.run-e2e-tests }}" - prepare_hermes_workspace: - runs-on: ubuntu-latest - if: github.repository == 'facebook/react-native' - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion - 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 - - 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 }} - - build_hermesc_apple: - runs-on: macos-14 - needs: prepare_hermes_workspace - env: - HERMES_WS_DIR: /tmp/hermes - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build HermesC Apple - uses: ./.github/actions/build-hermesc-apple - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - - build_apple_slices_hermes: - runs-on: macos-14 - needs: [build_hermesc_apple, prepare_hermes_workspace] - env: - 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" - XROS_DEPLOYMENT_TARGET: "1.0" - MAC_DEPLOYMENT_TARGET: "10.15" - strategy: - fail-fast: false - matrix: - flavor: [Debug, Release] - slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Slice - uses: ./.github/actions/build-apple-slices-hermes - 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 }} - - build_hermes_macos: - runs-on: macos-14 - needs: [build_apple_slices_hermes, prepare_hermes_workspace] - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin - continue-on-error: true - strategy: - fail-fast: false - matrix: - flavor: [Debug, Release] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Hermes MacOS - uses: ./.github/actions/build-hermes-macos - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - flavor: ${{ matrix.flavor }} - prebuild_apple_dependencies: if: github.repository == 'facebook/react-native' uses: ./.github/workflows/prebuild-ios-dependencies.yml @@ -123,12 +43,12 @@ jobs: with: use-hermes-nightly: ${{ !endsWith(github.ref_name, '-stable') }} secrets: inherit - needs: [prebuild_apple_dependencies, build_hermes_macos] + needs: [prebuild_apple_dependencies] test_ios_rntester_ruby_3_2_0: runs-on: macos-14 needs: - [build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] + [prebuild_apple_dependencies, prebuild_react_native_core] steps: - name: Checkout uses: actions/checkout@v4 @@ -136,14 +56,12 @@ jobs: uses: ./.github/actions/test-ios-rntester with: ruby-version: "3.2.0" - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} flavor: Debug test_ios_rntester: runs-on: macos-14-large needs: - [build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] + [prebuild_apple_dependencies, prebuild_react_native_core] continue-on-error: true strategy: fail-fast: false @@ -157,8 +75,6 @@ jobs: uses: ./.github/actions/test-ios-rntester with: use-frameworks: ${{ matrix.frameworks }} - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} flavor: ${{ matrix.flavor }} test_e2e_ios_rntester: @@ -194,9 +110,6 @@ jobs: test_e2e_ios_templateapp: runs-on: macos-14-large needs: [build_npm_package, prebuild_apple_dependencies] - env: - HERMES_WS_DIR: /tmp/hermes - HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin strategy: fail-fast: false matrix: @@ -214,11 +127,6 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 2.6.10 - - name: Download Hermes - uses: actions/download-artifact@v4 - with: - name: hermes-darwin-bin-${{matrix.flavor}} - path: /tmp/react-native-tmp - name: Download React Native Package uses: actions/download-artifact@v4 with: @@ -354,21 +262,6 @@ jobs: flavor: ${{ matrix.flavor }} working-directory: /tmp/RNTestProject - build_hermesc_linux: - runs-on: ubuntu-latest - 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 Linux - uses: ./.github/actions/build-hermesc-linux - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - run_fantom_tests: runs-on: 8-core-ubuntu needs: [set_release_type] @@ -388,25 +281,6 @@ jobs: release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }} gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - build_hermesc_windows: - runs-on: windows-2025 - 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' - 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 - with: - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - build_android: runs-on: 8-core-ubuntu needs: [set_release_type] @@ -461,10 +335,6 @@ jobs: 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, @@ -474,15 +344,12 @@ jobs: env: TERM: "dumb" GRADLE_OPTS: "-Dorg.gradle.daemon=false" - env: - HERMES_WS_DIR: /tmp/hermes steps: - name: Checkout uses: actions/checkout@v4 - name: Build NPM Package uses: ./.github/actions/build-npm-package with: - hermes-ws-dir: ${{ env.HERMES_WS_DIR }} release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }} gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} @@ -552,10 +419,9 @@ jobs: test_ios_helloworld_with_ruby_3_2_0: runs-on: macos-14 - needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs + needs: [prebuild_apple_dependencies, prebuild_react_native_core] env: PROJECT_NAME: iOSTemplateProject - HERMES_WS_DIR: /tmp/hermes YARN_ENABLE_IMMUTABLE_INSTALLS: false steps: - name: Checkout @@ -564,12 +430,10 @@ jobs: with: ruby-version: 3.2.0 flavor: Debug - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} test_ios_helloworld: runs-on: macos-14 - needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs + needs: [prebuild_apple_dependencies, prebuild_react_native_core] strategy: matrix: flavor: [Debug, Release] @@ -580,7 +444,6 @@ jobs: use_frameworks: StaticLibraries env: PROJECT_NAME: iOSTemplateProject - HERMES_WS_DIR: /tmp/hermes YARN_ENABLE_IMMUTABLE_INSTALLS: false steps: - name: Checkout @@ -589,8 +452,6 @@ jobs: with: flavor: ${{ matrix.flavor }} use-frameworks: ${{ matrix.use_frameworks }} - hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} - react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} test_js: runs-on: ubuntu-latest diff --git a/packages/react-native/scripts/hermes/prepare-hermes-for-build.js b/packages/react-native/scripts/hermes/prepare-hermes-for-build.js deleted file mode 100644 index fb9c95361f4..00000000000 --- a/packages/react-native/scripts/hermes/prepare-hermes-for-build.js +++ /dev/null @@ -1,47 +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. - * - * @flow strict-local - * @format - */ - -'use strict'; - -/** - * This script prepares Hermes to be built as part of the - * iOS build pipeline on macOS. - */ -const { - configureMakeForPrebuiltHermesC, - copyBuildScripts, - copyPodSpec, - downloadHermesSourceTarball, - expandHermesSourceTarball, - shouldBuildHermesFromSource, - shouldUsePrebuiltHermesC, -} = require('./hermes-utils'); - -async function main(isInCI /*: boolean */) { - if (!shouldBuildHermesFromSource(isInCI)) { - copyPodSpec(); - return; - } - downloadHermesSourceTarball(); - expandHermesSourceTarball(); - copyPodSpec(); - copyBuildScripts(); - - if (shouldUsePrebuiltHermesC('macos')) { - console.log('[Hermes] Using pre-built HermesC'); - configureMakeForPrebuiltHermesC(); - } -} - -const isInCI = process.env.CI === 'true'; - -void main(isInCI).then(() => { - process.exit(0); -});