Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
11 changes: 11 additions & 0 deletions .github/workflows/buildAdHoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ jobs:
const androidLink = '${{ needs.buildAndroid.outputs.ROCK_ARTIFACT_URL }}' || '';
const iosLink = '${{ needs.buildIOS.outputs.ROCK_ARTIFACT_URL }}' || '';
const mobileExpensifySHA = '${{ steps.getMobileExpensifySHA.outputs.SHA }}' || '';
const androidSentryLink = '${{ needs.buildAndroid.outputs.SENTRY_URL }}' || '';
const iosSentryLink = '${{ needs.buildIOS.outputs.SENTRY_URL }}' || '';

const webFailed = '${{ needs.buildWeb.result }}' === 'failure' || '${{ needs.deployWebAdHoc.result }}' === 'failure';
const webStatus = webLink ? '✅ Success' : webFailed ? '❌ Failed' : '⏭️ Skipped';
Expand All @@ -235,6 +237,15 @@ jobs:
],
]);

if (androidSentryLink || iosSentryLink) {
summary.addHeading('Bundle Size Analysis', 3);
summary.addTable([
[{data: 'Platform', header: true}, {data: 'Sentry Size Analysis', header: true}],
['Android', androidSentryLink ? `<a href="${androidSentryLink}">${androidSentryLink}</a>` : '-'],
['iOS', iosSentryLink ? `<a href="${iosSentryLink}">${iosSentryLink}</a>` : '-'],
]);
}

if (mobileExpensifySHA) {
const mobileExpensifyUrl = `https://github.com/Expensify/Mobile-Expensify/commit/${mobileExpensifySHA}`;
const label = '${{ inputs.MOBILE_EXPENSIFY_REF }}' ? 'Mobile-Expensify SHA (Custom)' : 'Mobile-Expensify Submodule SHA';
Expand Down
55 changes: 50 additions & 5 deletions .github/workflows/buildAndroid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ on:
ROCK_ARTIFACT_URL:
description: URL to download the ad-hoc build artifact (adhoc only)
value: ${{ jobs.build.outputs.ROCK_ARTIFACT_URL }}
SENTRY_URL:
description: URL to Sentry size analysis
value: ${{ jobs.build.outputs.SENTRY_URL }}
AAB_FILENAME:
description: Filename of the AAB artifact (empty if no AAB was produced)
value: ${{ jobs.build.outputs.AAB_FILENAME }}
Expand All @@ -57,6 +60,7 @@ jobs:
outputs:
VERSION_CODE: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }}
ROCK_ARTIFACT_URL: ${{ steps.set-artifact-url.outputs.ARTIFACT_URL }}
SENTRY_URL: ${{ steps.sentry-upload.outputs.SENTRY_URL }}
AAB_FILENAME: ${{ steps.collectArtifacts.outputs.AAB_FILENAME }}
APK_FILENAME: ${{ steps.collectArtifacts.outputs.APK_FILENAME }}
SOURCEMAP_FILENAME: index.android.bundle.map
Expand Down Expand Up @@ -185,6 +189,51 @@ jobs:
custom-identifier: ${{ steps.computeIdentifier.outputs.IDENTIFIER }}
validate-elf-alignment: false

- name: Set artifact URL output
id: set-artifact-url
if: ${{ inputs.variant == 'Adhoc' }}
run: echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_OUTPUT"

- name: Rock Remote Build - Android AAB (Sentry size analysis, AAB format is required)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than building an .aab separately, can we just try always building an .aab in the rock action above? I looked at the source code and bit and it suggests we should be able to distribute AdHoc builds with .aab just fine: https://github.com/callstackincubator/android/blob/4cedf4d9b5c167452c96fe67233577e0fde9a025/action.yml#L387-L394

Then we can convert the .aab into an .apk below (we already do that). and we can upload the .aab from the main build into Sentry

if: ${{ inputs.variant == 'Adhoc' }}
uses: callstackincubator/android@4cedf4d9b5c167452c96fe67233577e0fde9a025
env:
GITHUB_TOKEN: ${{ github.token }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
IS_HYBRID_APP: true
with:
variant: ${{ inputs.variant }}
aab: true
sign: true
re-sign: true
ad-hoc: false
keystore-file: './upload-key.keystore'
keystore-store-file: 'upload-key.keystore'
keystore-store-password: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}
keystore-key-alias: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }}
keystore-key-password: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }}
keystore-path: '../tools/buildtools/upload-key.keystore'
comment-bot: false
rock-build-extra-params: '--extra-params "-PreactNativeArchitectures=arm64-v8a,x86_64 --profile"'
custom-identifier: ${{ steps.computeIdentifier.outputs.IDENTIFIER }}-aab
validate-elf-alignment: false

- name: Upload Android build to Sentry for size analysis
id: sentry-upload
if: ${{ env.ARTIFACT_PATH != '' }}
continue-on-error: true
timeout-minutes: 5
run: |
OUTPUT=$(npx sentry-cli build upload "$ARTIFACT_PATH" --org expensify --project app --build-configuration ${{ inputs.variant == 'Adhoc' && 'AdHoc' || 'Release' }} --log-level debug 2>&1)
echo "$OUTPUT"
SENTRY_URL=$(echo "$OUTPUT" | grep -oE 'https://expensify\.sentry\.io/[^ ]+' | head -1)
if [ -n "$SENTRY_URL" ]; then
echo "::notice::Android Sentry size analysis: $SENTRY_URL"
echo "SENTRY_URL=$SENTRY_URL" >> "$GITHUB_OUTPUT"
fi
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Upload Gradle profile report
if: always()
# v6
Expand All @@ -194,11 +243,6 @@ jobs:
path: Mobile-Expensify/Android/build/reports/profile/
if-no-files-found: ignore

- name: Set artifact URL output
id: set-artifact-url
if: ${{ inputs.variant == 'Adhoc' }}
run: echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_OUTPUT"

- name: Collect build artifacts
id: collectArtifacts
run: |
Expand Down Expand Up @@ -290,3 +334,4 @@ jobs:
with:
name: ${{ inputs.artifact-prefix }}android-apk-artifact
path: Expensify.apk

21 changes: 21 additions & 0 deletions .github/workflows/buildIOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ on:
ROCK_ARTIFACT_URL:
description: URL to download the ad-hoc build artifact (adhoc only)
value: ${{ jobs.build.outputs.ROCK_ARTIFACT_URL }}
SENTRY_URL:
description: URL to Sentry size analysis
value: ${{ jobs.build.outputs.SENTRY_URL }}
IPA_FILENAME:
description: Filename of the IPA artifact produced by the build
value: ${{ jobs.build.outputs.IPA_FILENAME }}
Expand All @@ -55,6 +58,7 @@ jobs:
outputs:
IOS_VERSION: ${{ steps.getIOSVersion.outputs.IOS_VERSION }}
ROCK_ARTIFACT_URL: ${{ steps.set-artifact-url.outputs.ARTIFACT_URL }}
SENTRY_URL: ${{ steps.sentry-upload.outputs.SENTRY_URL }}
IPA_FILENAME: ${{ steps.set-ipa-filename.outputs.IPA_FILENAME }}
DSYM_FILENAME: ${{ steps.set-ipa-filename.outputs.DSYM_FILENAME }}
SOURCEMAP_FILENAME: main.jsbundle.map
Expand Down Expand Up @@ -235,6 +239,22 @@ jobs:
comment-bot: false
custom-identifier: ${{ steps.computeIdentifier.outputs.IDENTIFIER }}

- name: Upload iOS build to Sentry for size analysis
id: sentry-upload
if: ${{ env.ARTIFACT_PATH != '' }}
continue-on-error: true
timeout-minutes: 5
run: |
OUTPUT=$(npx sentry-cli build upload "$ARTIFACT_PATH" --org expensify --project app --build-configuration ${{ inputs.variant == 'Adhoc' && 'AdHoc' || 'Release' }} --log-level debug 2>&1)
echo "$OUTPUT"
SENTRY_URL=$(echo "$OUTPUT" | grep -oE 'https://expensify\.sentry\.io/[^ ]+' | head -1)
if [ -n "$SENTRY_URL" ]; then
echo "::notice::iOS Sentry size analysis: $SENTRY_URL"
echo "SENTRY_URL=$SENTRY_URL" >> "$GITHUB_OUTPUT"
fi
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Set artifact URL output
id: set-artifact-url
if: ${{ inputs.variant == 'Adhoc' }}
Expand Down Expand Up @@ -303,3 +323,4 @@ jobs:
with:
name: ${{ inputs.artifact-prefix }}ios-sourcemap-artifact
path: Mobile-Expensify/main.jsbundle.map

Loading
Loading