From fa5b69cff1c41e6d3fd8b7378f5d614fae70b786 Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 28 Jan 2025 17:29:57 -0800 Subject: [PATCH 1/2] Combine createNewVersion and createNewHybridAppVersion --- .github/workflows/createNewVersion.yml | 79 +++++++------------------- 1 file changed, 19 insertions(+), 60 deletions(-) diff --git a/.github/workflows/createNewVersion.yml b/.github/workflows/createNewVersion.yml index 29dddbcd3151..107606cb365a 100644 --- a/.github/workflows/createNewVersion.yml +++ b/.github/workflows/createNewVersion.yml @@ -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 + - name: Update Mobile-Expensify submodule with the latest state of the Mobile-Expensify main branch 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 - 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 \ @@ -179,15 +133,20 @@ jobs: ./iOS/SmartScanExtension/Info.plist \ ./iOS/NotificationServiceExtension/Info.plist git commit -m "Update version to ${{ needs.createNewVersion.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() }} From ff8e4265e2c2b8ca737503f635cdf9d04a45efd0 Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 29 Jan 2025 12:13:53 -0800 Subject: [PATCH 2/2] Fix outdated needs --- .github/workflows/createNewVersion.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/createNewVersion.yml b/.github/workflows/createNewVersion.yml index 107606cb365a..c7b8c9bdf12d 100644 --- a/.github/workflows/createNewVersion.yml +++ b/.github/workflows/createNewVersion.yml @@ -132,7 +132,7 @@ 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: Commit new E/App version