From a8bebfc4372ba0adc394c3dcdd390d128180c948 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 18 Jul 2025 00:19:17 +0530 Subject: [PATCH 01/51] Patch for android --- .github/workflows/build-android.yml | 2 +- .github/workflows/build-official-android.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 69ba410e2d8..cb651ef02c1 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -56,7 +56,7 @@ jobs: upload-android: name: Upload runs-on: ubuntu-latest - needs: [upload-hold] + needs: [upload-hold, build-android] if: ${{ inputs.type == 'experimental' }} steps: - name: Checkout Repository diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index e9795a07592..0faf3fe529c 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -56,7 +56,7 @@ jobs: upload-android: name: Upload runs-on: ubuntu-latest - needs: [upload-hold] + needs: [upload-hold, build-android] if: ${{ inputs.type == 'official' }} steps: - name: Checkout Repository From 5e0be0c5f0fd794e39fe779f8ccc2a817c07d949 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 18 Jul 2025 00:27:26 +0530 Subject: [PATCH 02/51] A big jump in offset... --- .github/actions/generate-version-code/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index 2e6262e52c7..37d410628b4 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -17,7 +17,7 @@ runs: run: | # This offset is from CircleCI after we migrated to Github Actions in order to have sequential builds - OFFSET=87750 + OFFSET=92000 VERSIONCODE=$((OFFSET + GITHUB_RUN_NUMBER)) echo "VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT From 863fb053ba6e2199a6a83b8722d75be544259248 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 18 Jul 2025 00:33:13 +0530 Subject: [PATCH 03/51] Added 40 mins timeout in build --- .github/actions/build-android/action.yml | 1 + .github/actions/build-ios/action.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/build-android/action.yml b/.github/actions/build-android/action.yml index a1b1f677d43..4a2b3ec4bfb 100644 --- a/.github/actions/build-android/action.yml +++ b/.github/actions/build-android/action.yml @@ -120,6 +120,7 @@ runs: shell: bash - name: Build Android Release AAB + timeout-minutes: 40 working-directory: android run: | if [[ "${{ inputs.type }}" == "experimental" ]]; then diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml index 44564dd4ac9..7ec20329519 100644 --- a/.github/actions/build-ios/action.yml +++ b/.github/actions/build-ios/action.yml @@ -90,6 +90,7 @@ runs: shell: bash - name: Build iOS app + timeout-minutes: 40 working-directory: ios run: | if [[ ${{ inputs.type }} == "official" ]]; then From 07db5c78e632b579e5ec7ff602953025d206ae05 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 18 Jul 2025 00:43:32 +0530 Subject: [PATCH 04/51] Removing timeout --- .github/actions/build-android/action.yml | 1 - .github/actions/build-ios/action.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/actions/build-android/action.yml b/.github/actions/build-android/action.yml index 4a2b3ec4bfb..a1b1f677d43 100644 --- a/.github/actions/build-android/action.yml +++ b/.github/actions/build-android/action.yml @@ -120,7 +120,6 @@ runs: shell: bash - name: Build Android Release AAB - timeout-minutes: 40 working-directory: android run: | if [[ "${{ inputs.type }}" == "experimental" ]]; then diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml index 7ec20329519..44564dd4ac9 100644 --- a/.github/actions/build-ios/action.yml +++ b/.github/actions/build-ios/action.yml @@ -90,7 +90,6 @@ runs: shell: bash - name: Build iOS app - timeout-minutes: 40 working-directory: ios run: | if [[ ${{ inputs.type }} == "official" ]]; then From ebdfd4cdedb6d7a1771c910785216c65799ff6a5 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 18 Jul 2025 01:03:56 +0530 Subject: [PATCH 05/51] Added timeout, please work... --- .github/workflows/build-android.yml | 1 + .github/workflows/build-ios.yml | 1 + .github/workflows/build-official-android.yml | 1 + .github/workflows/build-official-ios.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index cb651ef02c1..779a937f764 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -35,6 +35,7 @@ jobs: - name: Build Android uses: ./.github/actions/build-android + timeout-minutes: 40 with: type: 'experimental' BUGSNAG_KEY: ${{ secrets.BUGSNAG_KEY }} diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index d8e8bd7072b..a412f9ef48d 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -33,6 +33,7 @@ jobs: - name: Build iOS uses: ./.github/actions/build-ios + timeout-minutes: 40 with: type: experimental MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index 0faf3fe529c..48f6d43d8a0 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -35,6 +35,7 @@ jobs: - name: Build Android uses: ./.github/actions/build-android + timeout-minutes: 40 with: type: official GOOGLE_SERVICES_ANDROID: ${{ secrets.GOOGLE_SERVICES_ANDROID }} diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index 815995bb83f..55584adf40e 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -33,6 +33,7 @@ jobs: - name: Build iOS uses: ./.github/actions/build-ios + timeout-minutes: 40 with: type: official MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} From 387d20439ad89165f90cc5e8431db479aceb7297 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 18 Jul 2025 01:59:30 +0530 Subject: [PATCH 06/51] Remove the previous lint action to use a simgle one --- .github/workflows/lint-testunit.yml | 44 ----------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/lint-testunit.yml diff --git a/.github/workflows/lint-testunit.yml b/.github/workflows/lint-testunit.yml deleted file mode 100644 index 4f96fbc7093..00000000000 --- a/.github/workflows/lint-testunit.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Lint and Unit Tests - -on: - pull_request: - branches: - - '*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint-testunit: - if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Run ESLint - run: yarn lint - - - name: Run Tests - run: yarn test --runInBand From 3f74fea76e5fb874d2e006f28373366f64f3b439 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Sun, 20 Jul 2025 21:23:50 +0530 Subject: [PATCH 07/51] patch for ios circleci --- .circleci/config.yml | 2 +- ios/fastlane/Fastfile | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43d595c3e02..2700d33c128 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -354,7 +354,7 @@ commands: name: Fastlane Tesflight Upload command: | echo $APP_STORE_CONNECT_API_KEY_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8 - bundle exec fastlane ios beta official:<< parameters.official >> + bundle exec fastlane ios beta_circle_ci official:<< parameters.official >> working_directory: ios - save_cache: *save-gems-cache diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index cf7c0b98d65..8475fcbcedd 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -25,6 +25,27 @@ platform :ios do ) end + desc "Submit a new Beta Build to Apple TestFlight (Circle CI)" + lane :beta_circle_ci do |options| + api_key = app_store_connect_api_key( + key_id: ENV["APP_STORE_CONNECT_API_KEY_ID"], + issuer_id: ENV["APP_STORE_CONNECT_API_KEY_ISSUER_ID"], + key_filepath: 'fastlane/app_store_connect_api_key.p8', + in_house: false + ) + pilot( + ipa: 'ios/Rocket.Chat.ipa', + app_identifier: options[:official] ? 'chat.rocket.ios' : 'chat.rocket.reactnative', + skip_waiting_for_build_processing: true + ) + upload_symbols_to_crashlytics(dsym_path: "./ios/Rocket.Chat.app.dSYM.zip") + upload_symbols_to_bugsnag( + config_file: "./RocketChatRN/Info.plist", + dsym_path: "./ios/Rocket.Chat.app.dSYM.zip", + api_key: options[:official] ? ENV["BUGSNAG_KEY_OFFICIAL"] : ENV["BUGSNAG_KEY"] + ) + end + desc "Submit a new Beta Build to Apple TestFlight" lane :beta do |options| api_key = app_store_connect_api_key( From fe724ea264dde4bc318ab9d6d1452d76a18e04f1 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Sun, 20 Jul 2025 21:28:05 +0530 Subject: [PATCH 08/51] Android patch for circle ci --- .circleci/config.yml | 6 +++--- android/fastlane/Fastfile | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2700d33c128..36e002b9c94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -297,7 +297,7 @@ commands: - run: *update-fastlane-android - run: name: Fastlane Play Store Upload - command: bundle exec fastlane android beta official:<< parameters.official >> + command: bundle exec fastlane android beta_circle_ci official:<< parameters.official >> working_directory: android # EXPERIMENTAL ONLY @@ -314,7 +314,7 @@ commands: - run: *update-fastlane-android - run: name: Fastlane Play Store Upload - command: bundle exec fastlane android internal_app_sharing + command: bundle exec fastlane android internal_app_sharing_circle_ci working_directory: android # EXPERIMENTAL ONLY @@ -332,7 +332,7 @@ commands: - run: *update-fastlane-android - run: name: Fastlane Play Store Upload - command: bundle exec fastlane android production + command: bundle exec fastlane android production_circle_ci working_directory: android upload-to-testflight: diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 96dc7c6411f..f119781d1a3 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -33,6 +33,29 @@ platform :android do end end + desc "Upload App to Internal App Sharing (Circle CI)" + lane :internal_app_sharing_circle_ci do |options| + if options[:official] + upload_to_play_store_internal_app_sharing( + package_name: 'chat.rocket.android', + aab: 'android/app/build/outputs/bundle/officialRelease/app-official-release.aab' + ) + else + upload_to_play_store_internal_app_sharing( + package_name: 'chat.rocket.reactnative', + aab: 'android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' + ) + end + end + + desc "Upload App to Internal App Sharing (Circle CI)" + lane :internal_app_sharing_circle_ci do + upload_to_play_store_internal_app_sharing( + package_name: 'chat.rocket.reactnative', + aab: 'android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' + ) + end + desc "Upload App to Internal App Sharing" lane :internal_app_sharing do |options| if options[:official] @@ -48,6 +71,15 @@ platform :android do end end + desc "Upload App to Play Store Production (Circle CI)" + lane :production_circle_ci do |options| + upload_to_play_store( + package_name: 'chat.rocket.reactnative', + track: 'production', + aab: 'android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' + ) + end + desc "Upload App to Play Store Production" lane :production do |options| upload_to_play_store( From a0967fd1b5457bbcf2ca496a7a46f8a003308e36 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 22 Jul 2025 00:16:07 +0530 Subject: [PATCH 09/51] Fast lane to upload in specific channel --- android/fastlane/Fastfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index f119781d1a3..4dc9cc73851 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -81,11 +81,20 @@ platform :android do end desc "Upload App to Play Store Production" - lane :production do |options| + lane :experimental_production do |options| upload_to_play_store( package_name: 'chat.rocket.reactnative', track: 'production', aab: 'app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' ) end + + desc "Upload App to Play Store Open Testing" + lane :official_open_testing do |options| + upload_to_play_store( + package_name: 'chat.rocket.reactnative', + track: 'open', + aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' + ) + end end From 4a6d4cbd093f59eca8b13d443db7987663ca3866 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 22 Jul 2025 00:16:20 +0530 Subject: [PATCH 10/51] basic develop script --- .github/workflows/build-develop.yml | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/build-develop.yml diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml new file mode 100644 index 00000000000..f1ebb01f2bd --- /dev/null +++ b/.github/workflows/build-develop.yml @@ -0,0 +1,52 @@ +name: Build Develop + +permissions: + contents: read + +on: + push: + branches: + - 'develop' + +jobs: + run-eslint-and-test: + name: ESLint and Test + if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} + uses: ./.github/workflows/eslint.yml + + android-build-experimental-store: + name: Build Android Experimental + if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} + uses: ./.github/workflows/build-android.yml + needs: [run-eslint-and-test] + secrets: inherit + with: + type: experimental + isDevelopSync: true + + android-build-official-store: + name: Build Android Official + if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} + uses: ./.github/workflows/build-official-android.yml + needs: [run-eslint-and-test] + secrets: inherit + with: + type: official + + ios-build-experimental-store: + name: Build iOS Experimental + if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} + uses: ./.github/workflows/build-ios.yml + needs: [run-eslint-and-test] + secrets: inherit + with: + type: experimental + + ios-build-official-store: + name: Build iOS Official + if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} + uses: ./.github/workflows/build-official-ios.yml + needs: [run-eslint-and-test] + secrets: inherit + with: + type: official \ No newline at end of file From 208157856bf15736dce47757f08fd7254f67c4d4 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:06:53 +0530 Subject: [PATCH 11/51] Changes for releasing on prod --- .github/actions/upload-android/action.yml | 16 +++++++++++++++- .../actions/upload-internal-android/action.yml | 5 +++++ .github/actions/upload-ios/action.yml | 5 +++++ .github/workflows/build-android.yml | 5 +++++ .github/workflows/build-develop.yml | 7 +++++-- .github/workflows/build-ios.yml | 5 +++++ .github/workflows/build-official-android.yml | 5 +++++ .github/workflows/build-official-ios.yml | 5 +++++ .github/workflows/build-pr.yml | 6 +++++- 9 files changed, 55 insertions(+), 4 deletions(-) diff --git a/.github/actions/upload-android/action.yml b/.github/actions/upload-android/action.yml index ea5bccb4517..19bc7b75170 100644 --- a/.github/actions/upload-android/action.yml +++ b/.github/actions/upload-android/action.yml @@ -13,6 +13,10 @@ inputs: VERSIONCODE: description: 'Version code for build' required: true + trigger: + description: 'Trigger for build' + required: true + default: pr runs: using: "composite" @@ -52,10 +56,20 @@ runs: - name: Fastlane Play Store Upload working-directory: android run: | - bundle exec fastlane android beta official:${{ inputs.type == 'official' }} + if [[ ${{ inputs.trigger }} == "pr" ]]; then + bundle exec fastlane android beta official:${{ inputs.type == 'official' }} + fi + if [[ ${{ inputs.trigger }} == "push" ]] && [[ ${{ inputs.type }} == 'experimental' ]]; then + bundle exec fastlane android experimental_production + fi + if [[ ${{ inputs.trigger }} == "push" ]] && [[ ${{ inputs.type }} == 'official' ]]; then + bundle exec fastlane android official_open_testing + fi + shell: bash - name: Leave a comment on PR + if: ${{ inputs.trigger == 'pr' }} env: GH_TOKEN: ${{ inputs.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} diff --git a/.github/actions/upload-internal-android/action.yml b/.github/actions/upload-internal-android/action.yml index a872c5db8db..5ee0510c24a 100644 --- a/.github/actions/upload-internal-android/action.yml +++ b/.github/actions/upload-internal-android/action.yml @@ -13,6 +13,10 @@ inputs: VERSIONCODE: description: 'Version code for build' required: true + trigger: + description: 'Trigger for build' + required: false + default: pr runs: using: "composite" @@ -75,6 +79,7 @@ runs: shell: bash - name: Share Internal App Sharing Link + if: ${{ inputs.trigger == 'pr' }} env: GH_TOKEN: ${{ inputs.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} diff --git a/.github/actions/upload-ios/action.yml b/.github/actions/upload-ios/action.yml index cd183dad2a4..477151aab1c 100644 --- a/.github/actions/upload-ios/action.yml +++ b/.github/actions/upload-ios/action.yml @@ -28,6 +28,10 @@ inputs: GITHUB_TOKEN: description: 'GitHub token for commenting' required: true + trigger: + description: 'Trigger for build' + required: false + default: pr runs: using: "composite" @@ -138,6 +142,7 @@ runs: shell: bash - name: Comment on PR with TestFlight Info + if: ${{ inputs.trigger == 'pr' }} env: GH_TOKEN: ${{ inputs.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number }} diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 779a937f764..d6e6407824c 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -6,6 +6,10 @@ on: type: type: string required: true + trigger: + type: string + required: false + default: pr jobs: build-hold: @@ -70,6 +74,7 @@ jobs: uses: ./.github/actions/upload-android with: type: experimental + trigger: ${{ inputs.trigger }} FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index f1ebb01f2bd..3b3b50caaaa 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -22,7 +22,7 @@ jobs: secrets: inherit with: type: experimental - isDevelopSync: true + trigger: push android-build-official-store: name: Build Android Official @@ -32,6 +32,7 @@ jobs: secrets: inherit with: type: official + trigger: push ios-build-experimental-store: name: Build iOS Experimental @@ -41,6 +42,7 @@ jobs: secrets: inherit with: type: experimental + trigger: push ios-build-official-store: name: Build iOS Official @@ -49,4 +51,5 @@ jobs: needs: [run-eslint-and-test] secrets: inherit with: - type: official \ No newline at end of file + type: official + trigger: push \ No newline at end of file diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index a412f9ef48d..8b4c205d0ea 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -6,6 +6,10 @@ on: type: type: string required: true + trigger: + type: string + required: false + default: pr jobs: build-hold: @@ -62,6 +66,7 @@ jobs: uses: ./.github/actions/upload-ios with: type: experimental + trigger: ${{ inputs.trigger }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index 48f6d43d8a0..adf38a4ab88 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -6,6 +6,10 @@ on: type: type: string required: true + trigger: + type: string + required: false + default: pr jobs: build-hold: @@ -67,6 +71,7 @@ jobs: uses: ./.github/actions/upload-android with: type: official + trigger: ${{ inputs.trigger }} FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index 55584adf40e..99d1f6a33b3 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -6,6 +6,10 @@ on: type: type: string required: true + trigger: + type: string + required: false + default: pr jobs: build-hold: @@ -71,6 +75,7 @@ jobs: uses: ./.github/actions/upload-ios with: type: official + trigger: ${{ inputs.trigger }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index fcf7d3dcc32..351034673e5 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -23,6 +23,7 @@ jobs: secrets: inherit with: type: experimental + trigger: "pr" android-build-official-store: name: Build Android Official @@ -32,6 +33,7 @@ jobs: secrets: inherit with: type: official + trigger: "pr" ios-build-experimental-store: name: Build iOS Experimental @@ -41,6 +43,7 @@ jobs: secrets: inherit with: type: experimental + trigger: "pr" ios-build-official-store: name: Build iOS Official @@ -49,4 +52,5 @@ jobs: needs: [run-eslint-and-test] secrets: inherit with: - type: official \ No newline at end of file + type: official + trigger: "pr" \ No newline at end of file From 4877423faa9ae5efafa368759dc1fcab7b01ab0d Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:51:14 +0530 Subject: [PATCH 12/51] Remove duplicate task... --- android/fastlane/Fastfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 4dc9cc73851..da33fee782c 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -48,14 +48,6 @@ platform :android do end end - desc "Upload App to Internal App Sharing (Circle CI)" - lane :internal_app_sharing_circle_ci do - upload_to_play_store_internal_app_sharing( - package_name: 'chat.rocket.reactnative', - aab: 'android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' - ) - end - desc "Upload App to Internal App Sharing" lane :internal_app_sharing do |options| if options[:official] From 38dc6557cbaa0429ce30562f0a4a578652681edc Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 22 Jul 2025 20:50:45 +0530 Subject: [PATCH 13/51] Use setup node composite action in pretitter action too.. just to use single setup everywhere... --- .github/workflows/prettier.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index ddd98481eb9..10316d2ed95 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -20,22 +20,8 @@ jobs: with: fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - - - name: Install dependencies - run: yarn install + - name: Checkout and Setup Node + uses: ./.github/actions/setup-node - name: Run Prettier run: yarn prettier --write . From e16928a7e759ce6beffa1c84e28c501210faab35 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 22 Jul 2025 23:10:23 +0530 Subject: [PATCH 14/51] Added beta for circle ci --- android/fastlane/Fastfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index da33fee782c..3bdd4a49edc 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -16,6 +16,23 @@ default_platform(:android) platform :android do + desc "Upload App to Play Store Internal (Circle CI)" + lane :beta_circle_ci do |options| + if options[:official] + upload_to_play_store( + package_name: 'chat.rocket.android', + track: 'internal', + aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' + ) + else + upload_to_play_store( + package_name: 'chat.rocket.reactnative', + track: 'internal', + aab: 'app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' + ) + end + end + desc "Upload App to Play Store Internal" lane :beta do |options| if options[:official] From 0188a67ccc7a188826c78581a5b44c21f0eff77c Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 23 Jul 2025 01:21:35 +0530 Subject: [PATCH 15/51] Correct file path --- android/fastlane/Fastfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 3bdd4a49edc..59262ddbf14 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -22,13 +22,13 @@ platform :android do upload_to_play_store( package_name: 'chat.rocket.android', track: 'internal', - aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' + aab: 'android/app/build/outputs/bundle/officialRelease/app-official-release.aab' ) else upload_to_play_store( package_name: 'chat.rocket.reactnative', track: 'internal', - aab: 'app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' + aab: 'android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab' ) end end From 6f15f8e73ffa1954c165d1f307c21a7d0ed71085 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 23 Jul 2025 20:31:55 +0530 Subject: [PATCH 16/51] refresh commit --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 36e002b9c94..05a26376381 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -725,3 +725,4 @@ workflows: - android-google-play-production-experimental: requires: - android-automatic-build-experimental + \ No newline at end of file From fa34fc6312429b4b251daea2a913bebb05312de3 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 23 Jul 2025 20:32:02 +0530 Subject: [PATCH 17/51] revert --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 05a26376381..36e002b9c94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -725,4 +725,3 @@ workflows: - android-google-play-production-experimental: requires: - android-automatic-build-experimental - \ No newline at end of file From cba7e3ed42ea032ff67817ea7ba96519b1797082 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 23 Jul 2025 21:06:08 +0530 Subject: [PATCH 18/51] open testing is beta... --- android/fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 59262ddbf14..5a0b4687073 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -102,7 +102,7 @@ platform :android do lane :official_open_testing do |options| upload_to_play_store( package_name: 'chat.rocket.reactnative', - track: 'open', + track: 'beta', aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' ) end From 12a1ee4f506fc06d7d87d51ed4c83557b224a702 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:28:53 +0530 Subject: [PATCH 19/51] reser commit --- android/fastlane/Fastfile | 1 + 1 file changed, 1 insertion(+) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 5a0b4687073..6c43d9a8c19 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -107,3 +107,4 @@ platform :android do ) end end + \ No newline at end of file From ec58b09a1103d65b28b65980c2126ec466defeb6 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:28:58 +0530 Subject: [PATCH 20/51] revert --- android/fastlane/Fastfile | 1 - 1 file changed, 1 deletion(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 6c43d9a8c19..5a0b4687073 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -107,4 +107,3 @@ platform :android do ) end end - \ No newline at end of file From b76b36f7f26bff4b1258b8891112fc83fbf0af7c Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:27:11 +0530 Subject: [PATCH 21/51] Changed push to develop --- .github/actions/upload-android/action.yml | 4 ++-- .github/workflows/build-develop.yml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/actions/upload-android/action.yml b/.github/actions/upload-android/action.yml index 19bc7b75170..afca338624e 100644 --- a/.github/actions/upload-android/action.yml +++ b/.github/actions/upload-android/action.yml @@ -59,10 +59,10 @@ runs: if [[ ${{ inputs.trigger }} == "pr" ]]; then bundle exec fastlane android beta official:${{ inputs.type == 'official' }} fi - if [[ ${{ inputs.trigger }} == "push" ]] && [[ ${{ inputs.type }} == 'experimental' ]]; then + if [[ ${{ inputs.trigger }} == "develop" ]] && [[ ${{ inputs.type }} == 'experimental' ]]; then bundle exec fastlane android experimental_production fi - if [[ ${{ inputs.trigger }} == "push" ]] && [[ ${{ inputs.type }} == 'official' ]]; then + if [[ ${{ inputs.trigger }} == "develop" ]] && [[ ${{ inputs.type }} == 'official' ]]; then bundle exec fastlane android official_open_testing fi diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index 3b3b50caaaa..e478fe36675 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -6,7 +6,7 @@ permissions: on: push: branches: - - 'develop' + - 'chore.gh-build-patch' jobs: run-eslint-and-test: @@ -22,7 +22,7 @@ jobs: secrets: inherit with: type: experimental - trigger: push + trigger: develop android-build-official-store: name: Build Android Official @@ -32,7 +32,7 @@ jobs: secrets: inherit with: type: official - trigger: push + trigger: develop ios-build-experimental-store: name: Build iOS Experimental @@ -42,7 +42,7 @@ jobs: secrets: inherit with: type: experimental - trigger: push + trigger: develop ios-build-official-store: name: Build iOS Official @@ -52,4 +52,4 @@ jobs: secrets: inherit with: type: official - trigger: push \ No newline at end of file + trigger: develop \ No newline at end of file From 4756fe0c8ac3dde38262c9d6adcb9393ad4d692e Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:33:10 +0530 Subject: [PATCH 22/51] Hold only for PR --- .github/workflows/build-android.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index d6e6407824c..856dda2a55d 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -16,6 +16,7 @@ jobs: name: Hold runs-on: ubuntu-latest environment: experimental_android_build + if: ${{ inputs.trigger == 'pr' }} steps: - run: echo "Waiting for manual approval..." @@ -55,6 +56,7 @@ jobs: runs-on: ubuntu-latest needs: [build-android] environment: upload_experimental_android + if: ${{ inputs.trigger == 'pr' }} steps: - run: echo "Waiting for manual approval..." From a7c50fcddfaa3e958bf3bd61a94bf874e9db2ef5 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:41:17 +0530 Subject: [PATCH 23/51] env 2 --- .github/workflows/build-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 856dda2a55d..ab002e08dfc 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -15,7 +15,7 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest - environment: experimental_android_build + environment: ${{ inputs.trigger == 'pr' && 'experimental_android_build' || '' }} if: ${{ inputs.trigger == 'pr' }} steps: - run: echo "Waiting for manual approval..." From 427106a1982bcc17dcb51ff65efe89e13779660f Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:43:56 +0530 Subject: [PATCH 24/51] skip test --- .github/workflows/build-android.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index ab002e08dfc..c0031399301 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -15,8 +15,8 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest - environment: ${{ inputs.trigger == 'pr' && 'experimental_android_build' || '' }} - if: ${{ inputs.trigger == 'pr' }} + if: ${{ inputs.type != 'develop' }} + environment: experimental_android_build steps: - run: echo "Waiting for manual approval..." @@ -56,7 +56,6 @@ jobs: runs-on: ubuntu-latest needs: [build-android] environment: upload_experimental_android - if: ${{ inputs.trigger == 'pr' }} steps: - run: echo "Waiting for manual approval..." From 3ee5606a30187b21446550f292df61ec74b83e76 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:48:33 +0530 Subject: [PATCH 25/51] correct label --- .github/workflows/build-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index c0031399301..cfa0000a0a6 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -15,7 +15,7 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest - if: ${{ inputs.type != 'develop' }} + if: ${{ inputs.trigger != 'develop' }} environment: experimental_android_build steps: - run: echo "Waiting for manual approval..." From 975a1a95f22ac62716a753fb3fd3981148964e78 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 00:55:21 +0530 Subject: [PATCH 26/51] change --- .github/workflows/build-android.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index cfa0000a0a6..7f73ef29e3a 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -15,7 +15,7 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest - if: ${{ inputs.trigger != 'develop' }} + if: ${{ inputs.trigger == 'pr' }} environment: experimental_android_build steps: - run: echo "Waiting for manual approval..." @@ -24,7 +24,7 @@ jobs: name: Build runs-on: ubuntu-latest needs: [build-hold] - if: ${{ inputs.type == 'experimental' }} + if: ${{ inputs.type == 'experimental' && (always() && (needs.build-hold.result == 'success' || needs.build-hold.result == 'skipped')) }} outputs: VERSIONCODE: ${{ steps.version.outputs.VERSIONCODE }} steps: @@ -98,4 +98,4 @@ jobs: type: experimental FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} + VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} \ No newline at end of file From 2c972aa0edd3ef40c4c3caa486b0bbab013cc3ab Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 01:05:55 +0530 Subject: [PATCH 27/51] Correct hold logic --- .github/workflows/build-android.yml | 2 +- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-official-android.yml | 4 ++-- .github/workflows/build-official-ios.yml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 7f73ef29e3a..33c8848a9ea 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -63,7 +63,7 @@ jobs: name: Upload runs-on: ubuntu-latest needs: [upload-hold, build-android] - if: ${{ inputs.type == 'experimental' }} + if: ${{ inputs.type == 'experimental' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 8b4c205d0ea..f21087528c8 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -23,7 +23,7 @@ jobs: name: Build runs-on: macos-15 needs: [build-hold] - if: ${{ inputs.type == 'experimental' }} + if: ${{ inputs.type == 'experimental' && (always() && (needs.build-hold.result == 'success' || needs.build-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index adf38a4ab88..0e9eb69f90c 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -23,7 +23,7 @@ jobs: name: Build runs-on: ubuntu-latest needs: build-hold - if: ${{ inputs.type == 'official' }} + if: ${{ inputs.type == 'official' && (always() && (needs.build-hold.result == 'success' || needs.build-hold.result == 'skipped')) }} outputs: VERSIONCODE: ${{ steps.version.outputs.VERSIONCODE }} steps: @@ -62,7 +62,7 @@ jobs: name: Upload runs-on: ubuntu-latest needs: [upload-hold, build-android] - if: ${{ inputs.type == 'official' }} + if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index 99d1f6a33b3..ca216ce213c 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -23,7 +23,7 @@ jobs: name: Build runs-on: macos-15 needs: [build-hold] - if: ${{ inputs.type == 'official' }} + if: ${{ inputs.type == 'official' && (always() && (needs.build-hold.result == 'success' || needs.build-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -63,7 +63,7 @@ jobs: name: Upload runs-on: macos-15 needs: [upload-hold] - if: ${{ inputs.type == 'official' }} + if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 From 7f2abb78e84be611fcf378c0212c19728b050ba9 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 01:12:47 +0530 Subject: [PATCH 28/51] conditional hold --- .github/workflows/build-android.yml | 1 + .github/workflows/build-ios.yml | 1 + .github/workflows/build-official-android.yml | 2 ++ .github/workflows/build-official-ios.yml | 2 ++ 4 files changed, 6 insertions(+) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 33c8848a9ea..928bb0b2e64 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -55,6 +55,7 @@ jobs: name: Upload Hold runs-on: ubuntu-latest needs: [build-android] + if: ${{ inputs.trigger == 'pr' }} environment: upload_experimental_android steps: - run: echo "Waiting for manual approval..." diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index f21087528c8..7669a0ce72b 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -15,6 +15,7 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest + if: ${{ inputs.trigger == 'pr' }} environment: experimental_ios_build steps: - run: echo "Waiting for manual approval..." diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index 0e9eb69f90c..e7959f1e757 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -15,6 +15,7 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest + if: ${{ inputs.trigger == 'pr' }} environment: official_android_build steps: - run: echo "Waiting for manual approval..." @@ -53,6 +54,7 @@ jobs: upload-hold: name: Upload Hold runs-on: ubuntu-latest + if: ${{ inputs.trigger == 'pr' }} environment: upload_official_android needs: [build-android] steps: diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index ca216ce213c..a2386a70c72 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -15,6 +15,7 @@ jobs: build-hold: name: Hold runs-on: ubuntu-latest + if: ${{ inputs.trigger == 'pr' }} environment: official_ios_build steps: - run: echo "Waiting for manual approval..." @@ -54,6 +55,7 @@ jobs: upload-hold: name: Upload Hold runs-on: ubuntu-latest + if: ${{ inputs.trigger == 'pr' }} environment: upload_official_ios needs: [build-ios] steps: From 97db821a3249ffff172862a4f60500aa666fa10d Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 02:32:39 +0530 Subject: [PATCH 29/51] Get version code from store --- .../actions/generate-version-code/action.yml | 54 +++++++++++++++++++ .github/workflows/build-android.yml | 4 ++ .github/workflows/build-ios.yml | 4 ++ .github/workflows/build-official-android.yml | 4 ++ .github/workflows/build-official-ios.yml | 4 ++ android/fastlane/Fastfile | 38 +++++++++++++ ios/fastlane/Fastfile | 16 ++++++ 7 files changed, 124 insertions(+) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index 37d410628b4..3371a352eab 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -1,6 +1,20 @@ name: Generate Version Code description: Generates version code from GitHub run number +inputs: + official: + type: boolean + required: true + os: + type: string + required: true + FASTLANE_GOOGLE_SERVICE_ACCOUNT: + type: string + required: true + APP_STORE_CONNECT_API_KEY_BASE64: + type: string + required: true + outputs: VERSIONCODE: description: "Generated version code" @@ -9,6 +23,46 @@ outputs: runs: using: "composite" steps: + - name: Set up Ruby and Bundler + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.7 + bundler-cache: true + + - name: Install Fastlane + if: ${{ inputs.os == 'android' }} + working-directory: android + run: | + bundle install --path gems + shell: bash + + - name: Store the Google service account key + if: ${{ inputs.os == 'android' }} + working-directory: android + run: | + echo "${{ inputs.FASTLANE_GOOGLE_SERVICE_ACCOUNT }}" | base64 --decode > service_account.json + shell: bash + + - name: Decode p8 + if: ${{ inputs.os == 'ios' }} + run: | + echo ${{ inputs.APP_STORE_CONNECT_API_KEY_BASE64 }} | base64 --decode > ./ios/fastlane/app_store_connect_api_key.p8 + shell: bash + + - name: Compute VERSIONCODE (iOS) + if: ${{ inputs.os == 'ios' }} + shell: bash + run: | + fastlane ios get_testflight_version + working-directory: ios + + - name: Compute VERSIONCODE (Android) + if: ${{ inputs.os == 'android' }} + shell: bash + run: | + fastlane android version_code + working-directory: android + - name: Compute VERSIONCODE id: compute shell: bash diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 928bb0b2e64..5b19e42e36b 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -37,6 +37,10 @@ jobs: - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code + with: + official: false + os: android + FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} - name: Build Android uses: ./.github/actions/build-android diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 7669a0ce72b..123243a1881 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -35,6 +35,10 @@ jobs: - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code + with: + official: false + os: ios + APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} - name: Build iOS uses: ./.github/actions/build-ios diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index e7959f1e757..4a7894b2a03 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -37,6 +37,10 @@ jobs: - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code + with: + official: true + os: android + FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} - name: Build Android uses: ./.github/actions/build-android diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index a2386a70c72..93c17fca553 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -35,6 +35,10 @@ jobs: - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code + with: + official: true + os: ios + APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} - name: Build iOS uses: ./.github/actions/build-ios diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 5a0b4687073..ec7db6a8d59 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -16,6 +16,44 @@ default_platform(:android) platform :android do + desc 'Get the highest version code from all tracks' + lane :version_code |options| + production_versions = google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'fastlane/play_store.json', + track: 'production' + ) + + beta_versions = google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'fastlane/play_store.json', + track: 'beta' + ) + + alpha_versions = google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'fastlane/play_store.json', + track: 'alpha' + ) + + internal_versions = google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'fastlane/play_store.json', + track: 'internal' + ) + + all_versions = production_versions + beta_versions + alpha_versions + internal_versions + highest_version = all_versions.max + + UI.message("All: #{all_versions}") + UI.success("Highest: #{highest_version}") + UI.success("Highest + 1: #{highest_version + 1}") + + next_version = highest_version + 1 + + puts next_version + end + desc "Upload App to Play Store Internal (Circle CI)" lane :beta_circle_ci do |options| if options[:official] diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 8475fcbcedd..d13ad7dd78d 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -25,6 +25,22 @@ platform :ios do ) end + desc "Get testflight version" + lane :get_testflight_version do |options| + api_key = app_store_connect_api_key( + key_id: ENV["APP_STORE_CONNECT_API_KEY_ID"], + issuer_id: ENV["APP_STORE_CONNECT_API_KEY_ISSUER_ID"], + key_filepath: 'fastlane/app_store_connect_api_key.p8', + in_house: false + ) + latest_version = latest_testflight_build_number( + app_identifier: options[:official] ? 'chat.rocket.ios' : 'chat.rocket.reactnative' + ) + + UI.message("Latest version: #{latest_version}") + puts latest_version + end + desc "Submit a new Beta Build to Apple TestFlight (Circle CI)" lane :beta_circle_ci do |options| api_key = app_store_connect_api_key( From b90edc4b1afeb4e08a8ee7592fb56551e80ed43c Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 02:39:55 +0530 Subject: [PATCH 30/51] Correct ruby for android --- android/fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index ec7db6a8d59..e4e1068df3f 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -17,7 +17,7 @@ default_platform(:android) platform :android do desc 'Get the highest version code from all tracks' - lane :version_code |options| + lane :version_code do |options| production_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', json_key: 'fastlane/play_store.json', From 44acd0af049f64f87dca372da3d273485e76284b Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 02:46:07 +0530 Subject: [PATCH 31/51] using bundle exec... --- .github/actions/generate-version-code/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index 3371a352eab..cc2d57c1e00 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -53,14 +53,14 @@ runs: if: ${{ inputs.os == 'ios' }} shell: bash run: | - fastlane ios get_testflight_version + bundle exec fastlane ios get_testflight_version working-directory: ios - name: Compute VERSIONCODE (Android) if: ${{ inputs.os == 'android' }} shell: bash run: | - fastlane android version_code + bundle exec fastlane android version_code working-directory: android - name: Compute VERSIONCODE From 19640943002c9ed6d96b4d298dc92f7c6e9ea795 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 02:56:14 +0530 Subject: [PATCH 32/51] remove play json file --- android/fastlane/Fastfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index e4e1068df3f..38810b4fae5 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -20,25 +20,21 @@ platform :android do lane :version_code do |options| production_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'fastlane/play_store.json', track: 'production' ) beta_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'fastlane/play_store.json', track: 'beta' ) alpha_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'fastlane/play_store.json', track: 'alpha' ) internal_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'fastlane/play_store.json', track: 'internal' ) From 6ba1e45e79c93cb6d195705de30b261975627f28 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:02:22 +0530 Subject: [PATCH 33/51] use service_account... --- .github/workflows/build-android.yml | 4 ++-- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-official-android.yml | 4 ++-- .github/workflows/build-official-ios.yml | 4 ++-- android/fastlane/Fastfile | 4 ++++ 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 5b19e42e36b..ac3646c7792 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -68,7 +68,7 @@ jobs: name: Upload runs-on: ubuntu-latest needs: [upload-hold, build-android] - if: ${{ inputs.type == 'experimental' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} + if: ${{ inputs.type == 'experimental' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped') && needs.build-android.result == 'success') }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -89,7 +89,7 @@ jobs: name: Internal Sharing runs-on: ubuntu-latest needs: [build-android] - if: ${{ inputs.type == 'experimental' }} + if: ${{ inputs.type == 'experimental' && (always() && (needs.build-android.result == 'success')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 123243a1881..0fb1fe01a52 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -59,7 +59,7 @@ jobs: name: Upload runs-on: macos-15 needs: [build-ios] - if: ${{ inputs.type == 'experimental' }} + if: ${{ inputs.type == 'experimental' && (always() && (needs.build-ios.result == 'success')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index 4a7894b2a03..f83db498add 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -68,7 +68,7 @@ jobs: name: Upload runs-on: ubuntu-latest needs: [upload-hold, build-android] - if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} + if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped') && needs.build-android.result == 'success') }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -86,7 +86,7 @@ jobs: name: Internal Sharing runs-on: ubuntu-latest needs: [build-android] - if: ${{ inputs.type == 'official' }} + if: ${{ inputs.type == 'official' && (always() && (needs.build-android.result == 'success')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index 93c17fca553..9647c2f55ac 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -68,8 +68,8 @@ jobs: upload-ios: name: Upload runs-on: macos-15 - needs: [upload-hold] - if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} + needs: [upload-hold, build-ios] + if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped') && (needs.build-ios.result == 'success')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 38810b4fae5..17702af90eb 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -20,21 +20,25 @@ platform :android do lane :version_code do |options| production_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', track: 'production' ) beta_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', track: 'beta' ) alpha_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', track: 'alpha' ) internal_versions = google_play_track_version_codes( package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', track: 'internal' ) From 85f5332ffce49cc176f4bfee75f6a1408fa655f4 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:13:22 +0530 Subject: [PATCH 34/51] Run only one action for build pr and develop and cancel old one --- .github/workflows/build-develop.yml | 4 ++++ .github/workflows/build-pr.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index e478fe36675..addb7178978 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -8,6 +8,10 @@ on: branches: - 'chore.gh-build-patch' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: run-eslint-and-test: name: ESLint and Test diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 351034673e5..f0e83eaf052 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -9,6 +9,10 @@ on: branches: - '*' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: run-eslint-and-test: name: ESLint and Test From f8938e37ab8ea31fb087676b7a4b87cf931a243e Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:13:33 +0530 Subject: [PATCH 35/51] added retry in android fastlane --- android/fastlane/Fastfile | 65 ++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 17702af90eb..82a6d36d6eb 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -16,31 +16,55 @@ default_platform(:android) platform :android do + def with_retries(times: 3, sleep_time: 10) + tries = 0 + begin + yield + rescue => e + tries += 1 + if tries < times + UI.error("Retrying due to error: #{e}") + sleep(sleep_time) + retry + else + raise + end + end + end + desc 'Get the highest version code from all tracks' lane :version_code do |options| - production_versions = google_play_track_version_codes( - package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'service_account.json', - track: 'production' - ) + production_versions = with_retries do + google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', + track: 'production' + ) + end - beta_versions = google_play_track_version_codes( - package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'service_account.json', - track: 'beta' - ) + beta_versions = with_retries do + google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', + track: 'beta' + ) + end - alpha_versions = google_play_track_version_codes( - package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'service_account.json', - track: 'alpha' - ) + alpha_versions = with_retries do + google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', + track: 'alpha' + ) + end - internal_versions = google_play_track_version_codes( - package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', - json_key: 'service_account.json', - track: 'internal' - ) + internal_versions = with_retries do + google_play_track_version_codes( + package_name: options[:official] ? 'chat.rocket.android' : 'chat.rocket.reactnative', + json_key: 'service_account.json', + track: 'internal' + ) + end all_versions = production_versions + beta_versions + alpha_versions + internal_versions highest_version = all_versions.max @@ -50,7 +74,6 @@ platform :android do UI.success("Highest + 1: #{highest_version + 1}") next_version = highest_version + 1 - puts next_version end From b0ab60f623dbaa96dcd507bf532251f9e4ed61e9 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:19:17 +0530 Subject: [PATCH 36/51] let see if old action stop or not --- .github/actions/upload-internal-android/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/upload-internal-android/action.yml b/.github/actions/upload-internal-android/action.yml index 5ee0510c24a..77f00d8fee4 100644 --- a/.github/actions/upload-internal-android/action.yml +++ b/.github/actions/upload-internal-android/action.yml @@ -17,7 +17,7 @@ inputs: description: 'Trigger for build' required: false default: pr - + runs: using: "composite" steps: From f8162d65a9b5c9967a67906d5d3e5a88ef024e60 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:24:28 +0530 Subject: [PATCH 37/51] return highest number like ios, will add 1 in normal --- android/fastlane/Fastfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 82a6d36d6eb..e5da1781ffe 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -73,8 +73,7 @@ platform :android do UI.success("Highest: #{highest_version}") UI.success("Highest + 1: #{highest_version + 1}") - next_version = highest_version + 1 - puts next_version + puts highest_version end desc "Upload App to Play Store Internal (Circle CI)" From 0a4fe1c3e86ffc81a9908f7825fcae33a878b0b8 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:24:34 +0530 Subject: [PATCH 38/51] use xcode for ios --- .github/actions/generate-version-code/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index cc2d57c1e00..b271cfef4d8 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -23,6 +23,12 @@ outputs: runs: using: "composite" steps: + - name: Set up Xcode + if: ${{ inputs.os == 'ios' }} + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.2' + - name: Set up Ruby and Bundler uses: ruby/setup-ruby@v1 with: From c522cd2dea5192d34ccfd70e5db59d56328c65c1 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:28:29 +0530 Subject: [PATCH 39/51] removed concurrency temp --- .github/workflows/build-develop.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index addb7178978..e478fe36675 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -8,10 +8,6 @@ on: branches: - 'chore.gh-build-patch' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: run-eslint-and-test: name: ESLint and Test From c81e40e10fab2b66dc19441f6105e6c21dba5035 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:38:13 +0530 Subject: [PATCH 40/51] ios env for app store --- .../actions/generate-version-code/action.yml | 25 +++++++++++++++++++ .github/workflows/build-ios.yml | 6 +++++ .github/workflows/build-official-ios.yml | 6 +++++ 3 files changed, 37 insertions(+) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index b271cfef4d8..907aa25e169 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -14,6 +14,24 @@ inputs: APP_STORE_CONNECT_API_KEY_BASE64: type: string required: true + MATCH_KEYCHAIN_NAME: + type: string + required: false + MATCH_KEYCHAIN_PASSWORD: + type: string + required: false + MATCH_PASSWORD: + type: string + required: false + APP_STORE_CONNECT_API_KEY_ID: + type: string + required: false + APP_STORE_CONNECT_API_KEY_ISSUER_ID: + type: string + required: false + FASTLANE_REPO_PAT: + type: string + required: false outputs: VERSIONCODE: @@ -61,6 +79,13 @@ runs: run: | bundle exec fastlane ios get_testflight_version working-directory: ios + env: + MATCH_KEYCHAIN_NAME: ${{ inputs.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ inputs.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ inputs.MATCH_PASSWORD }} + APP_STORE_CONNECT_API_KEY_ID: ${{ inputs.APP_STORE_CONNECT_API_KEY_ID }} + APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ inputs.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} + FASTLANE_REPO_PAT: ${{ inputs.FASTLANE_REPO_PAT }} - name: Compute VERSIONCODE (Android) if: ${{ inputs.os == 'android' }} diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 0fb1fe01a52..ba4985429d3 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -39,6 +39,12 @@ jobs: official: false os: ios APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} + FASTLANE_REPO_PAT: ${{ secrets.FASTLANE_REPO_PAT }} - name: Build iOS uses: ./.github/actions/build-ios diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index 9647c2f55ac..cd8787be860 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -39,6 +39,12 @@ jobs: official: true os: ios APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} + FASTLANE_REPO_PAT: ${{ secrets.FASTLANE_REPO_PAT }} - name: Build iOS uses: ./.github/actions/build-ios From 4647caa857ad656708e3081289eb3a5705cb6435 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:53:42 +0530 Subject: [PATCH 41/51] change to logic --- .github/actions/generate-version-code/action.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index 907aa25e169..5c714d8147e 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -74,10 +74,12 @@ runs: shell: bash - name: Compute VERSIONCODE (iOS) + id: compute-versioncode-ios if: ${{ inputs.os == 'ios' }} shell: bash run: | - bundle exec fastlane ios get_testflight_version + VERSIONCODE=$(bundle exec fastlane ios get_testflight_version | tail -n1) + echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT working-directory: ios env: MATCH_KEYCHAIN_NAME: ${{ inputs.MATCH_KEYCHAIN_NAME }} @@ -88,22 +90,21 @@ runs: FASTLANE_REPO_PAT: ${{ inputs.FASTLANE_REPO_PAT }} - name: Compute VERSIONCODE (Android) + id: compute-versioncode-android if: ${{ inputs.os == 'android' }} shell: bash run: | - bundle exec fastlane android version_code + VERSIONCODE=$(bundle exec fastlane android version_code | tail -n1) + echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT working-directory: android - name: Compute VERSIONCODE id: compute shell: bash env: - GITHUB_RUN_NUMBER: ${{ github.run_number }} + LATEST_VERSIONCODE: ${{ steps.compute-versioncode-ios.outputs.LATEST_VERSIONCODE }} || ${{ steps.compute-versioncode-android.outputs.LATEST_VERSIONCODE }} run: | - # This offset is from CircleCI after we migrated to Github Actions in order to have sequential builds - - OFFSET=92000 - VERSIONCODE=$((OFFSET + GITHUB_RUN_NUMBER)) + VERSIONCODE=$((LATEST_VERSIONCODE + 1)) echo "VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT echo "### 📦 Version Code Generated" >> $GITHUB_STEP_SUMMARY From 3426dfcdb4d55bee78b7f147f4c12094d1fb22c9 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:55:37 +0530 Subject: [PATCH 42/51] logic 2 --- .github/actions/generate-version-code/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index 5c714d8147e..ac3f02f70c8 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -101,9 +101,12 @@ runs: - name: Compute VERSIONCODE id: compute shell: bash - env: - LATEST_VERSIONCODE: ${{ steps.compute-versioncode-ios.outputs.LATEST_VERSIONCODE }} || ${{ steps.compute-versioncode-android.outputs.LATEST_VERSIONCODE }} run: | + VERSION_IOS="${{ steps.compute-versioncode-ios.outputs.LATEST_VERSIONCODE }}" + VERSION_ANDROID="${{ steps.compute-versioncode-android.outputs.LATEST_VERSIONCODE }}" + + LATEST_VERSIONCODE="${VERSION_IOS:-$VERSION_ANDROID}" + VERSIONCODE=$((LATEST_VERSIONCODE + 1)) echo "VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT From fbb6de8ed214f5a73bac1d36ae67153918033b82 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 04:02:52 +0530 Subject: [PATCH 43/51] Change logic --- .github/actions/generate-version-code/action.yml | 4 ++-- android/fastlane/Fastfile | 2 +- ios/fastlane/Fastfile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index ac3f02f70c8..13f203e8d27 100644 --- a/.github/actions/generate-version-code/action.yml +++ b/.github/actions/generate-version-code/action.yml @@ -78,7 +78,7 @@ runs: if: ${{ inputs.os == 'ios' }} shell: bash run: | - VERSIONCODE=$(bundle exec fastlane ios get_testflight_version | tail -n1) + VERSIONCODE=$(bundle exec fastlane ios get_testflight_version | grep 'VERSIONCODE=' | cut -d '=' -f2) echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT working-directory: ios env: @@ -94,7 +94,7 @@ runs: if: ${{ inputs.os == 'android' }} shell: bash run: | - VERSIONCODE=$(bundle exec fastlane android version_code | tail -n1) + VERSIONCODE=$(bundle exec fastlane android version_code | grep 'VERSIONCODE=' | cut -d '=' -f2) echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT working-directory: android diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index e5da1781ffe..7216b88ee83 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -73,7 +73,7 @@ platform :android do UI.success("Highest: #{highest_version}") UI.success("Highest + 1: #{highest_version + 1}") - puts highest_version + puts "VERSIONCODE=#{highest_version}" end desc "Upload App to Play Store Internal (Circle CI)" diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index d13ad7dd78d..3040cddd876 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -38,7 +38,7 @@ platform :ios do ) UI.message("Latest version: #{latest_version}") - puts latest_version + puts "VERSIONCODE=#{latest_version}" end desc "Submit a new Beta Build to Apple TestFlight (Circle CI)" From dd1e0c94c74c8261d1fbd37b8ba9a2c342fb2ee8 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 04:23:01 +0530 Subject: [PATCH 44/51] upload android to Internal Sharing only in pull request runs --- .github/workflows/build-android.yml | 2 +- .github/workflows/build-official-android.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index ac3646c7792..60e8d2fef17 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -89,7 +89,7 @@ jobs: name: Internal Sharing runs-on: ubuntu-latest needs: [build-android] - if: ${{ inputs.type == 'experimental' && (always() && (needs.build-android.result == 'success')) }} + if: ${{ inputs.type == 'experimental' && inputs.trigger == 'pr' }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index f83db498add..46a62242671 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -86,7 +86,7 @@ jobs: name: Internal Sharing runs-on: ubuntu-latest needs: [build-android] - if: ${{ inputs.type == 'official' && (always() && (needs.build-android.result == 'success')) }} + if: ${{ inputs.type == 'official' && inputs.trigger == 'pr' }} steps: - name: Checkout Repository uses: actions/checkout@v4 From 78d66fb82c5c7bb4320af92aa741c9371ebdeeb2 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:35:48 +0530 Subject: [PATCH 45/51] Some changes --- .github/workflows/build-official-android.yml | 4 ++-- .github/workflows/build-official-ios.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index 46a62242671..c035d515a89 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -67,8 +67,8 @@ jobs: upload-android: name: Upload runs-on: ubuntu-latest - needs: [upload-hold, build-android] - if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped') && needs.build-android.result == 'success') }} + needs: [upload-hold] + if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index cd8787be860..e2440548fbd 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -74,8 +74,8 @@ jobs: upload-ios: name: Upload runs-on: macos-15 - needs: [upload-hold, build-ios] - if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped') && (needs.build-ios.result == 'success')) }} + needs: [upload-hold] + if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} steps: - name: Checkout Repository uses: actions/checkout@v4 From 982dea46dc9d207e9b4c253e3dbcb06c69abafbc Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 24 Jul 2025 23:32:00 +0530 Subject: [PATCH 46/51] upload to internal testing --- android/fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 7216b88ee83..c10a87a0deb 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -162,7 +162,7 @@ platform :android do lane :official_open_testing do |options| upload_to_play_store( package_name: 'chat.rocket.reactnative', - track: 'beta', + track: 'internal', aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' ) end From 17680cc39c27a279d2b8766043c138f29bbe08c8 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 25 Jul 2025 01:44:51 +0530 Subject: [PATCH 47/51] Removed develop run circleci scripts --- .circleci/config.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 36e002b9c94..4320729ccce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -714,14 +714,4 @@ workflows: requires: - android-hold-google-play-beta-official - # Android Automatic Experimental - - android-automatic-build-experimental: - filters: - branches: - only: - - develop - requires: - - lint-testunit - - android-google-play-production-experimental: - requires: - - android-automatic-build-experimental + From d66e0c4df1c67f8b6991bb307c2afdd6cbaa540d Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 25 Jul 2025 08:42:21 +0530 Subject: [PATCH 48/51] Update Fastfile --- android/fastlane/Fastfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index c10a87a0deb..c0fbc74b910 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -150,7 +150,7 @@ platform :android do end desc "Upload App to Play Store Production" - lane :experimental_production do |options| + lane :experimental_production upload_to_play_store( package_name: 'chat.rocket.reactnative', track: 'production', @@ -159,10 +159,10 @@ platform :android do end desc "Upload App to Play Store Open Testing" - lane :official_open_testing do |options| + lane :official_open_testing upload_to_play_store( - package_name: 'chat.rocket.reactnative', - track: 'internal', + package_name: 'chat.rocket.android', + track: 'open', aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' ) end From b57e09a123362cc2e21fe4102ff135912d98cacc Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 25 Jul 2025 09:01:53 +0530 Subject: [PATCH 49/51] Update Fastfile --- android/fastlane/Fastfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index c0fbc74b910..23dcdc8098b 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -150,7 +150,7 @@ platform :android do end desc "Upload App to Play Store Production" - lane :experimental_production + lane :experimental_production do upload_to_play_store( package_name: 'chat.rocket.reactnative', track: 'production', @@ -159,7 +159,7 @@ platform :android do end desc "Upload App to Play Store Open Testing" - lane :official_open_testing + lane :official_open_testing do upload_to_play_store( package_name: 'chat.rocket.android', track: 'open', From 1031e78299f99d87154a5a4d5fe3ba661a39d56e Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 25 Jul 2025 09:23:08 +0530 Subject: [PATCH 50/51] It's beta track but ui shows open testing... --- android/fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 23dcdc8098b..da9c958269f 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -162,7 +162,7 @@ platform :android do lane :official_open_testing do upload_to_play_store( package_name: 'chat.rocket.android', - track: 'open', + track: 'beta', aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' ) end From 44534a936c2e4115172d4d292894ddf389ebd066 Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:15:12 +0530 Subject: [PATCH 51/51] Trigger on develop branch --- .github/workflows/build-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index e478fe36675..48ffc62e564 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -6,7 +6,7 @@ permissions: on: push: branches: - - 'chore.gh-build-patch' + - 'develop' jobs: run-eslint-and-test: