From 1fb1f28af95a5ca6355834b2cf07602b69074485 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 28 Oct 2024 13:36:45 -0600 Subject: [PATCH] Merge pull request #51602 from Expensify/andrew-fix-commit [No QA]Remove extra back slash in git add command (cherry picked from commit 73b77851d5bafc827ab9ade4bd1349c0d687bdbd) (CP triggered by AndrewGable) --- .github/workflows/createNewVersion.yml | 92 ++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/.github/workflows/createNewVersion.yml b/.github/workflows/createNewVersion.yml index ca9a128e848d..309af16ca059 100644 --- a/.github/workflows/createNewVersion.yml +++ b/.github/workflows/createNewVersion.yml @@ -101,3 +101,95 @@ jobs: uses: ./.github/actions/composite/announceFailedWorkflowInSlack with: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +<<<<<<< HEAD +======= + + createNewHybridVersion: + runs-on: macos-latest + needs: [validateActor, createNewVersion] + if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }} + defaults: + run: + working-directory: Mobile-Expensify + 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 + # 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: Check out `Mobile-Expensify` repo + uses: actions/checkout@v4 + with: + repository: 'Expensify/Mobile-Expensify' + submodules: true + path: 'Mobile-Expensify' + token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }} + + - name: Update submodule + run: | + cd react-native + git submodule update --init + + - name: Setup git for OSBotify + uses: ./.github/actions/composite/setupGitForOSBotify + id: setupGitForOSBotify + with: + GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + + - name: Generate HybridApp version + run: | + # 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}') + FULL_APP_VERSION="$SHORT_APP_VERSION.$BUILD_NUMBER" + ANDROID_VERSION_CODE=$(echo "$FULL_APP_VERSION" | ruby -e "puts '05%02d%02d%02d%02d' % STDIN.read.split('.')") + + # File paths to update + ANDROID_MANIFEST_FILE="Android/AndroidManifest.xml" + IOS_INFO_PLIST_FILE="iOS/Expensify/Expensify-Info.plist" + IOS_SHARE_EXTENSION_PLIST_FILE="iOS/SmartScanExtension/Info.plist" + JS_CONFIG_FILE="app/config/config.json" + + # Update Android HybridApp Version + sed -i .bak -E "s/versionName=\"([0-9\.]*)\"/versionName=\"$FULL_APP_VERSION\"/" $ANDROID_MANIFEST_FILE + sed -i .bak -E "s/versionCode=\"([0-9]*)\"/versionCode=\"$ANDROID_VERSION_CODE\"/" $ANDROID_MANIFEST_FILE + + # Update iOS HybridApp Version + /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_APP_VERSION" $IOS_INFO_PLIST_FILE + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_INFO_PLIST_FILE + /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_APP_VERSION" $IOS_SHARE_EXTENSION_PLIST_FILE + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_SHARE_EXTENSION_PLIST_FILE + + # 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 }} + + - name: Commit new version + run: | + git add \ + ./Android/AndroidManifest.xml \ + ./app/config/config.json \ + ./iOS/Expensify/Expensify-Info.plist\ + ./iOS/SmartScanExtension/Info.plist + git commit -m "Update version to ${{ needs.createNewVersion.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 }} +>>>>>>> 73b7785 (Merge pull request #51602 from Expensify/andrew-fix-commit)