Skip to content
Merged
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
36 changes: 29 additions & 7 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
outputs:
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}
steps:
- name: Validate actor
uses: ./.github/actions/composite/validateActor
with:
OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Run turnstyle
uses: softprops/turnstyle@49108bdfa571e62371bd2c3094893c547ab3fc03
with:
Expand All @@ -62,11 +67,6 @@ jobs:
# This is a workaround to allow pushes to a protected branch
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Validate actor
uses: ./.github/actions/composite/validateActor
with:
OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Setup git for OSBotify
uses: Expensify/GitHub-Actions/setupGitForOSBotify@main
id: setupGitForOSBotify
Expand Down Expand Up @@ -129,7 +129,18 @@ jobs:
./iOS/SmartScanExtension/Info.plist \
./iOS/NotificationServiceExtension/Info.plist
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
git push origin main
if ! git push origin main; then
echo "Race condition! Mobile-Expensify main was updated while this workflow was running, so push failed. Fetching remote, rebasing, and retrying push once."
git fetch origin main --depth=1
if ! git rebase origin/main; then
echo "::error:: Rebase failed while retrying Mobile-Expensify push"
exit 1
fi
if ! git push origin main; then
echo "::error:: Mobile-Expensify change failed to push after rebase"
exit 1
fi
fi

- name: Commit new E/App version
run: |
Expand All @@ -146,7 +157,18 @@ jobs:
run: |
git add Mobile-Expensify
git commit -m "Update Mobile-Expensify submodule version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
git push origin main
if ! git push origin main; then
echo "Race condition! E/App main was updated while this workflow was running, so push failed. Fetching remote, rebasing, and retrying push once."
git fetch origin main --depth=1
if ! git rebase origin/main; then
echo "::error:: Rebase failed while retrying Mobile-Expensify push"
exit 1
fi
if ! git push origin main; then
echo "::error:: Mobile-Expensify change failed to push after rebase"
exit 1
fi
fi

- name: Announce failed workflow in Slack
if: ${{ failure() }}
Expand Down