Skip to content

[No QA] Cherry-pick Mobile-Expensify version bumps to Mobile-Expensify staging #59635

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 9 commits into from
Apr 5, 2025
48 changes: 41 additions & 7 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
submodules: true

# This command is necessary to fetch any branch other than main in the submodule.
# See https://github.com/actions/checkout/issues/1815#issuecomment-2777836442 for further context.
- name: Enable branch-switching in submodules
run: git submodule foreach 'git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"'

- name: Set up git for OSBotify
id: setupGitForOSBotify
uses: Expensify/GitHub-Actions/setupGitForOSBotify@main
Expand All @@ -40,30 +45,59 @@ jobs:
SEMVER_LEVEL: "PATCH"

- name: Fetch history of relevant refs
run: git fetch origin main staging --no-tags --shallow-exclude ${{ steps.getPreviousVersion.outputs.PREVIOUS_VERSION }}
run: |
git fetch origin main staging --no-tags --shallow-exclude ${{ steps.getPreviousVersion.outputs.PREVIOUS_VERSION }}
cd Mobile-Expensify
git fetch origin main staging --no-tags --shallow-exclude ${{ steps.getPreviousVersion.outputs.PREVIOUS_VERSION }}

- name: Get version bump commit
- name: Get E/App version bump commit
id: getVersionBumpCommit
run: |
git switch main
VERSION_BUMP_COMMIT="$(git log --format='%H' --author='OSBotify' --grep 'Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}')"
VERSION_BUMP_COMMIT="$(git log -1 --format='%H' --author='OSBotify' --grep 'Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}')"
if [ -z "$VERSION_BUMP_COMMIT" ]; then
echo "::error::❌ Could not find version bump commit for ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
echo "::error::❌ Could not find E/App version bump commit for ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
git log --oneline
else
echo "::notice::👀 Found version bump commit $VERSION_BUMP_COMMIT"
echo "::notice::👀 Found E/App version bump commit $VERSION_BUMP_COMMIT"
fi
echo "VERSION_BUMP_SHA=$VERSION_BUMP_COMMIT" >> "$GITHUB_OUTPUT"

- name: Get merge commit for pull request to CP
- name: Get Mobile-Expensify version bump commit
id: getMobileExpensifyVersionBumpCommit
working-directory: Mobile-Expensify
run: |
git switch main
VERSION_BUMP_COMMIT="$(git log -1 --format='%H' --author='OSBotify' --grep 'Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}')"
if [ -z "$VERSION_BUMP_COMMIT" ]; then
echo "::error::❌ Could not find Mobile-Expensify version bump commit for ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
git log --oneline
else
echo "::notice::👀 Found Mobile-Expensify version bump commit $VERSION_BUMP_COMMIT"
fi
echo "VERSION_BUMP_SHA=$VERSION_BUMP_COMMIT" >> "$GITHUB_OUTPUT"

- name: Get merge commit for E/App pull request to CP
id: getCPMergeCommit
uses: ./.github/actions/javascript/getPullRequestDetails
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USER: ${{ github.actor }}
PULL_REQUEST_NUMBER: ${{ github.event.inputs.PULL_REQUEST_NUMBER }}

- name: Cherry-pick the version-bump to staging
- name: Cherry-pick the Mobile-Expensify version bump to Mobile-Expensify staging
working-directory: Mobile-Expensify
run: |
git switch staging
git cherry-pick -S -x --mainline 1 --strategy=recursive -Xtheirs ${{ steps.getMobileExpensifyVersionBumpCommit.outputs.VERSION_BUMP_SHA }}
git push origin staging

- name: Update the Mobile-Expensify submodule on E/App staging
run: |
git add Mobile-Expensify
git commit -m "Update Mobile-Expensify submodule version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"

- name: Cherry-pick the E/App version-bump to staging
run: |
git switch staging
git cherry-pick -S -x --mainline 1 --strategy=recursive -Xtheirs ${{ steps.getVersionBumpCommit.outputs.VERSION_BUMP_SHA }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ jobs:
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}

- name: Commit new Mobile-Expensify version
working-directory: Mobile-Expensify
run: |
cd Mobile-Expensify
git add \
./Android/AndroidManifest.xml \
./app/config/config.json \
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
submodules: true

- name: Validate actor
id: validateActor
Expand All @@ -48,6 +49,9 @@ jobs:
run: |
git tag ${{ steps.getAppVersion.outputs.VERSION }}
git push origin --tags
cd Mobile-Expensify
git tag ${{ steps.getAppVersion.outputs.VERSION }}
git push origin --tags

# Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform
deployChecklist:
Expand Down