Skip to content

Commit a289b58

Browse files
authored
Merge pull request #85814 from software-mansion-labs/war-in/fix-patched-artifacts-RN-83
[No QA] fix: standalone Android build & ignore fmt check when building React Native artifacts
2 parents 6d289e3 + 02f2adc commit a289b58

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/publishReactNativeAndroidArtifacts.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
name: Build and Publish React Native Artifacts
127127
runs-on: ${{ github.repository_owner == 'Expensify' && 'blacksmith-16vcpu-ubuntu-2404' || 'blacksmith-2vcpu-ubuntu-2404' }}
128128
needs: verifyPatches
129-
if: needs.verifyPatches.outputs.build_targets != ''
129+
if: needs.verifyPatches.outputs.build_targets != ''
130130
strategy:
131131
# Disable fail-fast to prevent cancelling both jobs when only one needs to be stopped due to concurrency limits
132132
fail-fast: false
@@ -160,7 +160,7 @@ jobs:
160160

161161
- name: Setup Gradle
162162
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244
163-
163+
164164
- name: Determine new patched RN version
165165
id: getNewPatchedVersion
166166
run: echo "NEW_PATCHED_VERSION=$(./.github/scripts/getNewPatchedRNVersion.sh)" >> "$GITHUB_OUTPUT"
@@ -175,14 +175,26 @@ jobs:
175175
echo "Version: ${{ env.PATCHED_VERSION }}"
176176
echo "Patches hash: ${{ env.PATCHES_HASH }}"
177177
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
178-
./gradlew buildReactNativeArtifacts -PpatchedArtifacts.forceBuildFromSource=true -x lint -x test -x check
178+
179+
# Exclude ktfmt and test tasks from the included react-native build
180+
EXCLUDE_TASKS=(
181+
-x :react-native:packages:react-native:ReactAndroid:ktfmtCheck
182+
-x :react-native:packages:react-native:ReactAndroid:ktfmtCheckMain
183+
-x :react-native:packages:react-native:ReactAndroid:ktfmtCheckScripts
184+
-x :react-native:packages:react-native:ReactAndroid:testDebugOptimizedUnitTest
185+
-x :react-native:packages:react-native:ReactAndroid:testDebugUnitTest
186+
-x :react-native:packages:react-native:ReactAndroid:testReleaseUnitTest
187+
)
188+
189+
./gradlew buildReactNativeArtifacts -PpatchedArtifacts.forceBuildFromSource=true -x lint -x test -x check "${EXCLUDE_TASKS[@]}"
179190
./gradlew publishReactNativeArtifacts -PpatchedArtifacts.forceBuildFromSource=true
180191
env:
181192
GH_PUBLISH_ACTOR: ${{ github.actor }}
182193
GH_PUBLISH_TOKEN: ${{ github.token }}
183194
IS_HYBRID_BUILD: ${{ matrix.is_hybrid }}
184195
PATCHED_VERSION: ${{ steps.getNewPatchedVersion.outputs.NEW_PATCHED_VERSION }}
185196
PATCHES_HASH: ${{ matrix.is_hybrid == 'true' && needs.verifyPatches.outputs.hybrid_app_patches_hash || needs.verifyPatches.outputs.standalone_patches_hash }}
197+
CMAKE_VERSION: 3.31.6
186198

187199
- name: Announce failed workflow in Slack
188200
if: ${{ failure() }}

android/settings.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ if(settings.extensions.patchedArtifacts.buildFromSource) {
3737
}
3838
}
3939

40-
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
41-
useExpoModules()
4240
expoAutolinking {
43-
projectRoot = file(rootDir)
41+
projectRoot = file('../')
42+
searchPaths = ['node_modules']
4443
useExpoModules()
4544
}

0 commit comments

Comments
 (0)