diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml index 44564dd4ac9..27c995bf862 100644 --- a/.github/actions/build-ios/action.yml +++ b/.github/actions/build-ios/action.yml @@ -34,10 +34,22 @@ inputs: BUGSNAG_KEY_OFFICIAL: description: 'Bugsnag API Key Official' required: true + GOOGLE_SERVICES_IOS: + description: 'Google service file for official version' + required: true + GOOGLE_SERVICES_IOS_EXPERIMENTAL: + description: 'Google service file for experimental version' + required: true runs: using: "composite" steps: + - name: Remove simulator and its cache + run : | + xcrun simctl delete all + sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/* + shell: bash + - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1 with: @@ -89,6 +101,18 @@ runs: fi shell: bash + - name: Set Google Services + working-directory: ios + run: | + if [[ $APP_STORE_CONNECT_API_KEY_BASE64 ]]; then + if [[ ${{ inputs.type }} == "official" ]]; then + echo ${{ inputs.GOOGLE_SERVICES_IOS }} | base64 --decode > GoogleService-Info.plist + else + echo ${{ inputs.GOOGLE_SERVICES_IOS_EXPERIMENTAL }} | base64 --decode > GoogleService-Info.plist + fi + fi + shell: bash + - name: Build iOS app working-directory: ios run: | @@ -147,4 +171,4 @@ runs: if: ${{ inputs.type == 'official' }} with: name: ios-build-official-info-plist - path: ios/RocketChatRN/Info.plist \ No newline at end of file + path: ios/RocketChatRN/Info.plist diff --git a/.github/actions/fetch-supported-versions/action.yaml b/.github/actions/fetch-supported-versions/action.yaml new file mode 100644 index 00000000000..a2e992f36bc --- /dev/null +++ b/.github/actions/fetch-supported-versions/action.yaml @@ -0,0 +1,20 @@ +name: Fetch supported versions +description: Fetch supported versions from Cloud +inputs: + build_name: + description: Name of the build + required: true + +runs: + using: "composite" + steps: + - name: Fetch supported versions from Cloud + shell: bash + run: sh ./scripts/fetch-supported-versions.sh + + - name: Update supported versions + uses: actions/upload-artifact@v4 + with: + name: supported-versions-${{ inputs.build_name }} + path: ./app-supportedversions.json + \ No newline at end of file diff --git a/.github/actions/generate-version-code/action.yml b/.github/actions/generate-version-code/action.yml index 13f203e8d27..a4c227710ea 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 | grep 'VERSIONCODE=' | cut -d '=' -f2) + VERSIONCODE=$(bundle exec fastlane ios get_testflight_version official:${{ inputs.official }} | 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 | grep 'VERSIONCODE=' | cut -d '=' -f2) + VERSIONCODE=$(bundle exec fastlane android version_code official:${{ inputs.official }}| grep 'VERSIONCODE=' | cut -d '=' -f2) echo "LATEST_VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT working-directory: android @@ -111,4 +111,4 @@ runs: echo "VERSIONCODE=$VERSIONCODE" >> $GITHUB_OUTPUT echo "### 📦 Version Code Generated" >> $GITHUB_STEP_SUMMARY - echo "\`Version Code: $VERSIONCODE\`" >> $GITHUB_STEP_SUMMARY \ No newline at end of file + echo "\`Version Code: $VERSIONCODE\`" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 60e8d2fef17..b73d3bb8017 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -33,6 +33,11 @@ jobs: - name: Checkout and Setup Node uses: ./.github/actions/setup-node + + - name: Fetch supported versions from Cloud + uses: ./.github/actions/fetch-supported-versions + with: + build_name: 'android-experimental' - name: Generate Version Code id: version @@ -61,6 +66,8 @@ jobs: needs: [build-android] if: ${{ inputs.trigger == 'pr' }} environment: upload_experimental_android + outputs: + VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} steps: - run: echo "Waiting for manual approval..." @@ -83,7 +90,7 @@ jobs: trigger: ${{ inputs.trigger }} FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} + VERSIONCODE: ${{ needs.upload-hold.outputs.VERSIONCODE }} upload-internal: name: Internal Sharing @@ -103,4 +110,4 @@ jobs: type: experimental FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} \ No newline at end of file + VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index ba4985429d3..6deaa679d1d 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -32,6 +32,11 @@ jobs: - name: Checkout and Setup Node uses: ./.github/actions/setup-node + - name: Fetch supported versions from Cloud + uses: ./.github/actions/fetch-supported-versions + with: + build_name: 'ios-experimental' + - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code @@ -48,7 +53,7 @@ jobs: - name: Build iOS uses: ./.github/actions/build-ios - timeout-minutes: 40 + timeout-minutes: 60 with: type: experimental MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} @@ -59,6 +64,8 @@ jobs: FASTLANE_REPO_PAT: ${{ secrets.FASTLANE_REPO_PAT }} BUGSNAG_KEY: ${{ secrets.BUGSNAG_KEY }} APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} + GOOGLE_SERVICES_IOS: ${{ secrets.GOOGLE_SERVICES_IOS }} + GOOGLE_SERVICES_IOS_EXPERIMENTAL: ${{ secrets.GOOGLE_SERVICES_IOS_EXPERIMENTAL }} VERSIONCODE: ${{ steps.version.outputs.VERSIONCODE }} upload-ios: @@ -84,6 +91,5 @@ jobs: 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 }} - BUGSNAG_KEY: ${{ secrets.BUGSNAG_KEY }} APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index c035d515a89..f6c34770fe4 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -34,6 +34,11 @@ jobs: - name: Checkout and Setup Node uses: ./.github/actions/setup-node + - name: Fetch supported versions from Cloud + uses: ./.github/actions/fetch-supported-versions + with: + build_name: 'android-official' + - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code @@ -61,6 +66,8 @@ jobs: if: ${{ inputs.trigger == 'pr' }} environment: upload_official_android needs: [build-android] + outputs: + VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} steps: - run: echo "Waiting for manual approval..." @@ -80,7 +87,7 @@ jobs: trigger: ${{ inputs.trigger }} FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSIONCODE: ${{ needs.build-android.outputs.VERSIONCODE }} + VERSIONCODE: ${{ needs.upload-hold.outputs.VERSIONCODE }} upload-internal: name: Internal Sharing diff --git a/.github/workflows/build-official-ios.yml b/.github/workflows/build-official-ios.yml index e2440548fbd..d29eeeaed30 100644 --- a/.github/workflows/build-official-ios.yml +++ b/.github/workflows/build-official-ios.yml @@ -32,6 +32,11 @@ jobs: - name: Checkout and Setup Node uses: ./.github/actions/setup-node + - name: Fetch supported versions from Cloud + uses: ./.github/actions/fetch-supported-versions + with: + build_name: 'ios-official' + - name: Generate Version Code id: version uses: ./.github/actions/generate-version-code @@ -48,7 +53,7 @@ jobs: - name: Build iOS uses: ./.github/actions/build-ios - timeout-minutes: 40 + timeout-minutes: 60 with: type: official MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} @@ -60,6 +65,8 @@ jobs: BUGSNAG_KEY: ${{ secrets.BUGSNAG_KEY_OFFICIAL }} BUGSNAG_KEY_OFFICIAL: ${{ secrets.BUGSNAG_KEY_OFFICIAL }} APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} + GOOGLE_SERVICES_IOS: ${{ secrets.GOOGLE_SERVICES_IOS }} + GOOGLE_SERVICES_IOS_EXPERIMENTAL: ${{ secrets.GOOGLE_SERVICES_IOS_EXPERIMENTAL }} VERSIONCODE: ${{ steps.version.outputs.VERSIONCODE }} upload-hold: @@ -94,6 +101,5 @@ jobs: 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 }} - BUGSNAG_KEY: ${{ secrets.BUGSNAG_KEY }} APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}