Skip to content

Commit 16ce291

Browse files
authored
Merge pull request #59635 from Expensify/Rory-FixHybridAppCP
[No QA] Cherry-pick Mobile-Expensify version bumps to Mobile-Expensify staging
2 parents 7ade8d5 + 4b01eac commit 16ce291

File tree

3 files changed

+46
-8
lines changed

3 files changed

+46
-8
lines changed

.github/workflows/cherryPick.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
token: ${{ secrets.OS_BOTIFY_TOKEN }}
2525
submodules: true
2626

27+
# This command is necessary to fetch any branch other than main in the submodule.
28+
# See https://github.com/actions/checkout/issues/1815#issuecomment-2777836442 for further context.
29+
- name: Enable branch-switching in submodules
30+
run: git submodule foreach 'git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"'
31+
2732
- name: Set up git for OSBotify
2833
id: setupGitForOSBotify
2934
uses: Expensify/GitHub-Actions/setupGitForOSBotify@main
@@ -40,30 +45,59 @@ jobs:
4045
SEMVER_LEVEL: "PATCH"
4146

4247
- name: Fetch history of relevant refs
43-
run: git fetch origin main staging --no-tags --shallow-exclude ${{ steps.getPreviousVersion.outputs.PREVIOUS_VERSION }}
48+
run: |
49+
git fetch origin main staging --no-tags --shallow-exclude ${{ steps.getPreviousVersion.outputs.PREVIOUS_VERSION }}
50+
cd Mobile-Expensify
51+
git fetch origin main staging --no-tags --shallow-exclude ${{ steps.getPreviousVersion.outputs.PREVIOUS_VERSION }}
4452
45-
- name: Get version bump commit
53+
- name: Get E/App version bump commit
4654
id: getVersionBumpCommit
4755
run: |
4856
git switch main
49-
VERSION_BUMP_COMMIT="$(git log --format='%H' --author='OSBotify' --grep 'Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}')"
57+
VERSION_BUMP_COMMIT="$(git log -1 --format='%H' --author='OSBotify' --grep 'Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}')"
5058
if [ -z "$VERSION_BUMP_COMMIT" ]; then
51-
echo "::error::❌ Could not find version bump commit for ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
59+
echo "::error::❌ Could not find E/App version bump commit for ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
5260
git log --oneline
5361
else
54-
echo "::notice::👀 Found version bump commit $VERSION_BUMP_COMMIT"
62+
echo "::notice::👀 Found E/App version bump commit $VERSION_BUMP_COMMIT"
5563
fi
5664
echo "VERSION_BUMP_SHA=$VERSION_BUMP_COMMIT" >> "$GITHUB_OUTPUT"
5765
58-
- name: Get merge commit for pull request to CP
66+
- name: Get Mobile-Expensify version bump commit
67+
id: getMobileExpensifyVersionBumpCommit
68+
working-directory: Mobile-Expensify
69+
run: |
70+
git switch main
71+
VERSION_BUMP_COMMIT="$(git log -1 --format='%H' --author='OSBotify' --grep 'Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}')"
72+
if [ -z "$VERSION_BUMP_COMMIT" ]; then
73+
echo "::error::❌ Could not find Mobile-Expensify version bump commit for ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
74+
git log --oneline
75+
else
76+
echo "::notice::👀 Found Mobile-Expensify version bump commit $VERSION_BUMP_COMMIT"
77+
fi
78+
echo "VERSION_BUMP_SHA=$VERSION_BUMP_COMMIT" >> "$GITHUB_OUTPUT"
79+
80+
- name: Get merge commit for E/App pull request to CP
5981
id: getCPMergeCommit
6082
uses: ./.github/actions/javascript/getPullRequestDetails
6183
with:
6284
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6385
USER: ${{ github.actor }}
6486
PULL_REQUEST_NUMBER: ${{ github.event.inputs.PULL_REQUEST_NUMBER }}
6587

66-
- name: Cherry-pick the version-bump to staging
88+
- name: Cherry-pick the Mobile-Expensify version bump to Mobile-Expensify staging
89+
working-directory: Mobile-Expensify
90+
run: |
91+
git switch staging
92+
git cherry-pick -S -x --mainline 1 --strategy=recursive -Xtheirs ${{ steps.getMobileExpensifyVersionBumpCommit.outputs.VERSION_BUMP_SHA }}
93+
git push origin staging
94+
95+
- name: Update the Mobile-Expensify submodule on E/App staging
96+
run: |
97+
git add Mobile-Expensify
98+
git commit -m "Update Mobile-Expensify submodule version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
99+
100+
- name: Cherry-pick the E/App version-bump to staging
67101
run: |
68102
git switch staging
69103
git cherry-pick -S -x --mainline 1 --strategy=recursive -Xtheirs ${{ steps.getVersionBumpCommit.outputs.VERSION_BUMP_SHA }}

.github/workflows/createNewVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ jobs:
120120
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}
121121

122122
- name: Commit new Mobile-Expensify version
123+
working-directory: Mobile-Expensify
123124
run: |
124-
cd Mobile-Expensify
125125
git add \
126126
./Android/AndroidManifest.xml \
127127
./app/config/config.json \

.github/workflows/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
2424
with:
2525
token: ${{ secrets.OS_BOTIFY_TOKEN }}
26+
submodules: true
2627

2728
- name: Validate actor
2829
id: validateActor
@@ -48,6 +49,9 @@ jobs:
4849
run: |
4950
git tag ${{ steps.getAppVersion.outputs.VERSION }}
5051
git push origin --tags
52+
cd Mobile-Expensify
53+
git tag ${{ steps.getAppVersion.outputs.VERSION }}
54+
git push origin --tags
5155
5256
# Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform
5357
deployChecklist:

0 commit comments

Comments
 (0)