Skip to content

Commit

Permalink
Merge pull request #55915 from Expensify/Rory-CleanupCreateNewVersion
Browse files Browse the repository at this point in the history
[No QA] Combine createNewVersion and createNewHybridAppVersion
  • Loading branch information
AndrewGable authored Jan 30, 2025
2 parents 5a1958c + ff8e426 commit 9f6794a
Showing 1 changed file with 20 additions and 61 deletions.
81 changes: 20 additions & 61 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: main
submodules: true
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
# This is a workaround to allow pushes to a protected branch
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
@@ -75,70 +76,23 @@ jobs:
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Generate version
- name: Generate new E/App version
id: bumpVersion
uses: ./.github/actions/javascript/bumpVersion
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
SEMVER_LEVEL: ${{ inputs.SEMVER_LEVEL }}

- name: Commit new version
run: |
git add \
./package.json \
./package-lock.json \
./android/app/build.gradle \
./ios/NewExpensify/Info.plist \
./ios/NewExpensifyTests/Info.plist \
./ios/NotificationServiceExtension/Info.plist
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
- name: Update main branch
run: git push origin main

- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

createNewHybridVersion:
runs-on: macos-latest
needs: [validateActor, createNewVersion]
if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}
steps:
- name: Run turnstyle
uses: softprops/turnstyle@49108bdfa571e62371bd2c3094893c547ab3fc03
with:
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Check out `App` repo
uses: actions/checkout@v4
with:
ref: main
submodules: true
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
# This is a workaround to allow pushes to a protected branch
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Update submodule and checkout the main branch
- name: Update Mobile-Expensify submodule with the latest state of the Mobile-Expensify main branch
run: |
git submodule update --init
cd Mobile-Expensify
git checkout main
git pull origin main
- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
git fetch --depth=1 origin main
git reset --hard origin/main
- name: Generate HybridApp version
run: |
cd Mobile-Expensify
# Generate all flavors of the version
SHORT_APP_VERSION=$(echo "$NEW_VERSION" | awk -F'-' '{print $1}')
BUILD_NUMBER=$(echo "$NEW_VERSION" | awk -F'-' '{print $2}')
@@ -167,9 +121,9 @@ jobs:
# Update JS HybridApp Version
sed -i .bak -E "s/\"version\": \"([0-9\.]*)\"/\"version\": \"$FULL_APP_VERSION\"/" $JS_CONFIG_FILE
env:
NEW_VERSION: ${{ needs.createNewVersion.outputs.NEW_VERSION }}
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}

- name: Commit new version
- name: Commit new Mobile-Expensify version
run: |
cd Mobile-Expensify
git add \
@@ -178,16 +132,21 @@ jobs:
./iOS/Expensify/Expensify-Info.plist\
./iOS/SmartScanExtension/Info.plist \
./iOS/NotificationServiceExtension/Info.plist
git commit -m "Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
git push origin main
- name: Update main branch on Mobile-Expensify and App
- name: Commit new E/App version
run: |
cd Mobile-Expensify
git add \
./Mobile-Expensify
./package.json \
./package-lock.json \
./android/app/build.gradle \
./ios/NewExpensify/Info.plist \
./ios/NewExpensifyTests/Info.plist \
./ios/NotificationServiceExtension/Info.plist
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
git push origin main
cd ..
git add Mobile-Expensify
git commit -m "Update Mobile-Expensify to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
git push origin main
- name: Announce failed workflow in Slack
if: ${{ failure() }}

0 comments on commit 9f6794a

Please sign in to comment.