Skip to content

[No QA] Fix Conditional Logic in publish.gradle patch and publishReactNativeAndroidArtifacts.yml #61779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/publishReactNativeAndroidArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: echo "HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Get previous Mobile-Expensify commit hash
if: ${{ matrix.is_hybrid == 'true' }}
if: ${{ matrix.is_hybrid }}
id: getOldMobileExpensifyHash
run: echo "HASH=$(git rev-parse :Mobile-Expensify)" >> "$GITHUB_OUTPUT"

Expand All @@ -49,7 +49,7 @@ jobs:
run: echo "HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Get new Mobile-Expensify commit hash
if: ${{ matrix.is_hybrid == 'true' }}
if: ${{ matrix.is_hybrid }}
id: getNewMobileExpensifyHash
run: echo "HASH=$(git rev-parse :Mobile-Expensify)" >> "$GITHUB_OUTPUT"

Expand All @@ -70,14 +70,14 @@ jobs:
id: didPatchesChange
run: |
if ! git diff --exit-code --name-only ${{ steps.getOldAppHash.outputs.HASH }}..${{ steps.getNewAppHash.outputs.HASH }} -- patches/react-native+*.patch patches/@react-native+*.patch; then
echo "::notice::Detected changes in patches"
echo "::notice::Detected changes in patches (Standalone NewDot)"
echo "DID_PATCHES_CHANGE=true" >> "$GITHUB_OUTPUT"
exit 0
fi

if [[ '${{ matrix.is_hybrid }}' == 'true' ]]; then
if ! git -C Mobile-Expensify diff --exit-code --name-only ${{ steps.getOldMobileExpensifyHash.outputs.HASH }}..${{ steps.getNewMobileExpensifyHash.outputs.HASH }} -- patches/react-native+*.patch patches/@react-native+*.patch; then
echo "::notice::Detected changes in patches"
echo "::notice::Detected changes in patches (HybridApp)"
echo "DID_PATCHES_CHANGE=true" >> "$GITHUB_OUTPUT"
exit 0
fi
Expand Down Expand Up @@ -124,9 +124,9 @@ jobs:

- name: Build and publish RN artifacts
if: ${{ steps.shouldPublish.outputs.SHOULD_PUBLISH == 'true' }}
working-directory: ${{ matrix.is_hybrid == 'true' && 'Mobile-Expensify/Android' || 'android' }}
working-directory: ${{ matrix.is_hybrid && 'Mobile-Expensify/Android' || 'android' }}
run: |
echo "Starting artifacts build for ${{ matrix.is_hybrid == 'true' && 'HybridApp' || 'NewDot Standalone' }}"
echo "Starting artifacts build for ${{ matrix.is_hybrid && 'HybridApp' || 'NewDot Standalone' }}"
echo "Version: ${{ env.PATCHED_VERSION }}"
echo "Commit hash: ${{ env.COMMIT_HASH }}"
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
Expand Down
2 changes: 1 addition & 1 deletion patches/react-native+0.77.1+025.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ index 32287a7..5607be3 100644
+
+def patchedVersion = System.getenv("PATCHED_VERSION")
+def isHybridBuild = System.getenv("IS_HYBRID_BUILD")?.toBoolean()
+def publishingGroupId = isHybridBuild ? "com.expensify.react-standalone" : "com.expensify.react-hybrid"
+def publishingGroupId = isHybridBuild ? "com.expensify.react-hybrid" : "com.expensify.react-standalone"

publishing {
publications {
Expand Down
Loading