diff --git a/.github/workflows/createNewVersion.yml b/.github/workflows/createNewVersion.yml index 29dddbcd3151..c7b8c9bdf12d 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 - 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() }}