Skip to content

Commit 3e84a7d

Browse files
committed
Merge branch 'main' into andrew-hybrid-build-follow-ups
2 parents 53623ba + b79de18 commit 3e84a7d

File tree

153 files changed

+2258
-1589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2258
-1589
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build and profile Android apps
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
validateActor:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
READY_TO_BUILD: ${{ fromJSON(steps.isExpensifyEmployee.outputs.IS_EXPENSIFY_EMPLOYEE) && fromJSON(steps.hasReadyToBuildLabel.outputs.HAS_READY_TO_BUILD_LABEL) }}
11+
steps:
12+
- name: Is Expensify employee
13+
id: isExpensifyEmployee
14+
run: |
15+
if gh api /orgs/Expensify/teams/expensify-expensify/memberships/${{ github.actor }} --silent; then
16+
echo "IS_EXPENSIFY_EMPLOYEE=true" >> "$GITHUB_OUTPUT"
17+
else
18+
echo "IS_EXPENSIFY_EMPLOYEE=false" >> "$GITHUB_OUTPUT"
19+
fi
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
22+
23+
- id: hasReadyToBuildLabel
24+
name: Set HAS_READY_TO_BUILD_LABEL flag
25+
run: |
26+
echo "HAS_READY_TO_BUILD_LABEL=$(gh pr view "${{ env.PULL_REQUEST_NUMBER }}" --repo Expensify/App --json labels --jq '.labels[].name' | grep -q 'Ready To Build' && echo 'true')" >> "$GITHUB_OUTPUT"
27+
if [[ "$HAS_READY_TO_BUILD_LABEL" != 'true' ]]; then
28+
echo "The 'Ready to Build' label is not attached to the PR #${{ env.PULL_REQUEST_NUMBER }}"
29+
fi
30+
env:
31+
GITHUB_TOKEN: ${{ github.token }}
32+
33+
buildHybridAppAndroid:
34+
name: Build HybridApp Android
35+
needs: [validateActor]
36+
runs-on: macos-15-xlarge
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
with:
41+
submodules: true
42+
ref: ${{ github.event.pull_request.head.sha }}
43+
token: ${{ secrets.OS_BOTIFY_TOKEN }}
44+
45+
- name: Update submodule to match main
46+
run: |
47+
git submodule update --init --remote
48+
cd Mobile-Expensify
49+
git fetch
50+
git checkout main
51+
52+
- name: Configure MapBox SDK
53+
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
54+
55+
- name: Setup Node
56+
id: setup-node
57+
uses: ./.github/actions/composite/setupNode
58+
with:
59+
IS_HYBRID_BUILD: 'true'
60+
61+
- name: Build Android Release
62+
working-directory: Mobile-Expensify/Android
63+
run: |
64+
if ! ./gradlew --profile assembleRelease
65+
then
66+
echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
67+
exit 1
68+
else
69+
echo "✅ Build succeeded. Printing Gradle profile report:"
70+
# Print the latest generated profile report
71+
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
72+
cat "$PROFILE_REPORT"
73+
fi
74+
75+
buildStandaloneAndroid:
76+
name: Build Standalone Android
77+
needs: [ validateActor ]
78+
runs-on: macos-15-xlarge
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v4
82+
with:
83+
ref: ${{ github.event.pull_request.head.sha }}
84+
token: ${{ secrets.OS_BOTIFY_TOKEN }}
85+
86+
- name: Configure MapBox SDK
87+
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
88+
89+
- name: Setup Node
90+
id: setup-node
91+
uses: ./.github/actions/composite/setupNode
92+
with:
93+
IS_HYBRID_BUILD: 'false'
94+
95+
- name: Build Android Release
96+
working-directory: android
97+
run: |
98+
if ! ./gradlew --profile assembleProductionRelease
99+
then
100+
echo "❌ Android Standalone failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
101+
exit 1
102+
else
103+
echo "✅ Build succeeded. Printing Gradle profile report:"
104+
# Print the latest generated profile report
105+
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
106+
cat "$PROFILE_REPORT"
107+
fi

.github/workflows/testBuildHybrid.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
const pullRequest = await github.rest.pulls.get({
7878
owner: context.repo.owner,
7979
repo: context.repo.repo,
80-
pull_number: '${{ env.PULL_REQUEST_NUMBER }}'',
80+
pull_number: '${{ env.PULL_REQUEST_NUMBER }}',
8181
});
8282
8383
const body = pullRequest.data.body;
@@ -89,7 +89,6 @@ jobs:
8989
getOldDotBranchRef:
9090
runs-on: ubuntu-latest
9191
needs: getOldDotPR
92-
if: ${{ needs.getOldDotPR.outputs.OLD_DOT_PR != '' }}
9392
outputs:
9493
OLD_DOT_REF: ${{ steps.getHeadRef.outputs.REF }}
9594
steps:
@@ -100,9 +99,13 @@ jobs:
10099
id: getHeadRef
101100
run: |
102101
set -e
103-
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R 'Expensify/Mobile-Expensify' --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
102+
if [[ ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} == '' ]]; then
103+
echo "REF=" >> "$GITHUB_OUTPUT"
104+
else
105+
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R Expensify/Mobile-Expensify --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
106+
fi
104107
env:
105-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
106109

107110

108111
postGitHubCommentBuildStarted:
@@ -148,7 +151,7 @@ jobs:
148151
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
149152
run: |
150153
cd Mobile-Expensify
151-
git fetch
154+
git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
152155
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
153156
154157
- name: Configure MapBox SDK
@@ -259,7 +262,7 @@ jobs:
259262
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
260263
run: |
261264
cd Mobile-Expensify
262-
git fetch
265+
git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
263266
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
264267
265268
- name: Configure MapBox SDK
@@ -311,9 +314,9 @@ jobs:
311314
env:
312315
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
313316
run: |
314-
op document get --output ./OldApp_AdHoc.mobileprovision OldApp_AdHoc
315-
op document get --output ./OldApp_AdHoc_Share_Extension.mobileprovision OldApp_AdHoc_Share_Extension
316-
op document get --output ./OldApp_AdHoc_Notification_Service.mobileprovision OldApp_AdHoc_Notification_Service
317+
op read op://Mobile-Deploy-CI/OldApp_AdHoc/OldApp_AdHoc.mobileprovision --force --out-file ./OldApp_AdHoc.mobileprovision
318+
op read op://Mobile-Deploy-CI/OldApp_AdHoc_Share_Extension/OldApp_AdHoc_Share_Extension.mobileprovision --force --out-file ./OldApp_AdHoc_Share_Extension.mobileprovision
319+
op read op://Mobile-Deploy-CI/OldApp_AdHoc_Notification_Service/OldApp_AdHoc_Notification_Service.mobileprovision --force --out-file ./OldApp_AdHoc_Notification_Service.mobileprovision
317320
318321
- name: Decrypt certificate
319322
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg

Mobile-Expensify

0 commit comments

Comments
 (0)