feat(android): height issue fixed with keyboard avoiding component in new architecture #5508
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test All | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- "*-stable" | |
jobs: | |
set_release_type: | |
runs-on: ubuntu-latest | |
outputs: | |
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }} | |
env: | |
EVENT_NAME: ${{ github.event_name }} | |
REF: ${{ github.ref }} | |
steps: | |
- id: set_release_type | |
run: | | |
if [[ $EVENT_NAME == "schedule" ]]; then | |
echo "Setting release type to nightly" | |
echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT | |
elif [[ $EVENT_NAME == "push" && $REF == refs/tags/v* ]]; then | |
echo "Setting release type to release" | |
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT | |
else | |
echo "Setting release type to dry-run" | |
echo "RELEASE_TYPE=dry-run" >> $GITHUB_OUTPUT | |
fi | |
prepare_hermes_workspace: | |
runs-on: ubuntu-latest | |
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.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 }} | |
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }} | |
build_hermesc_apple: | |
runs-on: macos-13 | |
needs: prepare_hermes_workspace | |
env: | |
HERMES_WS_DIR: /tmp/hermes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Build HermesC Apple | |
uses: ./.github/actions/build-hermesc-apple | |
with: | |
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }} | |
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: "13.4" | |
XROS_DEPLOYMENT_TARGET: "1.0" | |
MAC_DEPLOYMENT_TARGET: "10.15" | |
strategy: | |
fail-fast: false | |
matrix: | |
flavor: [Debug, Release] | |
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- 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-13 | |
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.1.1 | |
- 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 }} | |
test_ios_rntester_ruby_3_2_0: | |
runs-on: macos-13 | |
needs: | |
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] | |
env: | |
HERMES_WS_DIR: /tmp/hermes | |
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Run it | |
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 }} | |
test_ios_rntester_dynamic_frameworks: | |
runs-on: macos-13 | |
needs: | |
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] | |
env: | |
HERMES_WS_DIR: /tmp/hermes | |
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
jsengine: [Hermes, JSC] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Run it | |
uses: ./.github/actions/test-ios-rntester | |
with: | |
jsengine: ${{ matrix.jsengine }} | |
use-frameworks: DynamicFrameworks | |
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} | |
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} | |
test_ios_rntester: | |
runs-on: macos-13 | |
needs: | |
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] | |
env: | |
HERMES_WS_DIR: /tmp/hermes | |
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
jsengine: [Hermes, JSC] | |
architecture: [NewArch, OldArch] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Run it | |
uses: ./.github/actions/test-ios-rntester | |
with: | |
jsengine: ${{ matrix.jsengine }} | |
architecture: ${{ matrix.architecture }} | |
run-unit-tests: "false" | |
use-frameworks: StaticLibraries | |
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} | |
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} | |
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.1.1 | |
- 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-2019 | |
needs: prepare_hermes_workspace | |
env: | |
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.1.1 | |
- name: Download Previous Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
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.0 | |
with: | |
name: hermes-win64-bin | |
path: D:\tmp\hermes\win64-bin\ | |
build_android: | |
runs-on: 8-core-ubuntu | |
needs: [set_release_type] | |
container: | |
image: reactnativecommunity/react-native-android:latest | |
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 }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Setup git safe folders | |
run: git config --global --add safe.directory '*' | |
- 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-artifacts-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }} | |
- name: Setup gradle | |
uses: ./.github/actions/setup-gradle | |
with: | |
cache-read-only: "false" | |
- 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 Maven Artifacts | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: maven-local-build-android | |
path: /tmp/maven-local | |
- name: Upload test results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4.3.0 | |
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.0 | |
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" | |
HERMES_WS_DIR: /tmp/hermes | |
steps: | |
- name: Add github.com to SSH known hosts | |
run: | | |
mkdir -p ~/.ssh | |
echo '|1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Setup git safe folders | |
run: git config --global --add safe.directory '*' | |
- 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: | |
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: 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: Use Node.js 18 | |
uses: actions/setup-node@v4.0.0 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Setup gradle | |
uses: ./.github/actions/setup-gradle | |
- name: Install dependencies | |
run: yarn install --non-interactive | |
- name: Build packages | |
run: yarn build | |
# Continue with publish steps | |
- name: Set npm credentials | |
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release' || | |
needs.set_release_type.outputs.RELEASE_TYPE == 'nightly' | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.CIRCLE_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 [[ "${{ 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 | |
node ./scripts/releases-ci/publish-npm.js -t ${{ needs.set_release_type.outputs.RELEASE_TYPE }} | |
- 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 }}\" }}" | |
test_android_helloworld: | |
runs-on: 4-core-ubuntu | |
needs: prepare_hermes_workspace | |
container: | |
image: reactnativecommunity/react-native-android:latest | |
env: | |
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in conatiners | |
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127 | |
LC_ALL: C.UTF8 | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
TERM: "dumb" | |
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | |
TARGET_ARCHITECTURE: "arm64-v8a" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
flavor: [Debug, Release] | |
architecture: [NewArch, OldArch] | |
jsengine: [Hermes, JSC] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Setup git safe folders | |
run: git config --global --add safe.directory '*' | |
- 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: Run yarn | |
shell: bash | |
run: yarn install --non-interactive | |
- name: Setup gradle | |
uses: ./.github/actions/setup-gradle | |
- name: Build CodeGen JS scripts | |
shell: bash | |
run: | | |
cd packages/react-native-codegen | |
yarn run build | |
- name: Monitor Disk utilization (before build) | |
shell: bash | |
if: always() | |
run: | | |
echo "On Runner:" | |
df -h | |
echo "Root:" | |
du -hs * | |
echo "Projects folder:" | |
du -hs ./packages/* | |
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine. | |
shell: bash | |
run: | | |
cd packages/helloworld/android | |
args=() | |
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then | |
args+=(--arch old) | |
fi | |
if [[ ${{ matrix.jsengine }} == "JSC" ]]; then | |
args+=(--jsvm jsc) | |
fi | |
if [[ ${{ matrix.flavor }} == "Release" ]]; then | |
args+=(--prod) | |
fi | |
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE" | |
- name: Monitor Disk utilization (after build) | |
shell: bash | |
if: always() | |
run: | | |
echo "On Runner:" | |
df -h | |
echo "Root:" | |
du -hs * | |
echo "Projects folder:" | |
du -hs ./packages/* | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: helloworld-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }} | |
path: ./packages/helloworld/android/app/build/outputs/apk/ | |
compression-level: 0 | |
test_ios_helloworld_with_ruby_3_2_0: | |
runs-on: macos-13 | |
needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs | |
env: | |
PROJECT_NAME: iOSTemplateProject | |
HERMES_WS_DIR: /tmp/hermes | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- uses: ./.github/actions/test-ios-helloworld | |
with: | |
ruby-version: 3.2.0 | |
architecture: NewArch | |
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-13 | |
needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs | |
strategy: | |
matrix: | |
flavor: [Debug, Release] | |
jsengine: [Hermes, JSC] | |
use_frameworks: [StaticLibraries, DynamicFrameworks] | |
exclude: | |
# This config is tested with Ruby 3.2.0. Let's not double test it. | |
- flavor: Debug | |
jsengine: Hermes | |
use_frameworks: StaticLibraries | |
env: | |
PROJECT_NAME: iOSTemplateProject | |
HERMES_WS_DIR: /tmp/hermes | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- uses: ./.github/actions/test-ios-helloworld | |
with: | |
flavor: ${{ matrix.flavor }} | |
jsengine: ${{ matrix.jsengine }} | |
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 | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: ["20", "18"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Test JS | |
uses: ./.github/actions/test-js | |
with: | |
node-version: ${{ matrix.node-version }} | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Run all the Linters | |
uses: ./.github/actions/lint | |
with: | |
github-token: ${{ env.GH_TOKEN }} |