diff --git a/.github/actions/upload-android/action.yml b/.github/actions/upload-android/action.yml index 7f1fb418089..d0ded94e45c 100644 --- a/.github/actions/upload-android/action.yml +++ b/.github/actions/upload-android/action.yml @@ -53,11 +53,37 @@ runs: echo "${{ inputs.FASTLANE_GOOGLE_SERVICE_ACCOUNT }}" | base64 --decode > service_account.json shell: bash + - uses: actions/download-artifact@v4 + with: + name: release-changelog + path: . + + - name: Prepare Play Store changelog metadata + run: | + mkdir -p android/fastlane/metadata/android/en-US/changelogs + + if [ -f changelog.txt ]; then + size=$(wc -c < changelog.txt) + + if [ "$size" -gt 500 ]; then + head -c 497 changelog.txt > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt + printf "..." >> android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt + else + cat changelog.txt > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt + fi + else + printf "Internal improvements and bug fixes" > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt + fi + shell: bash + env: + BUILD_VERSION: ${{ inputs.BUILD_VERSION }} + - name: Fastlane Play Store Upload working-directory: android run: | if [[ ${{ inputs.trigger }} == "pr" ]]; then - bundle exec fastlane android beta official:${{ inputs.type == 'official' }} + bundle exec fastlane android official_open_testing + # bundle exec fastlane android beta official:${{ inputs.type == 'official' }} fi if [[ ${{ inputs.trigger }} == "develop" ]] && [[ ${{ inputs.type }} == 'experimental' ]]; then bundle exec fastlane android experimental_production @@ -65,7 +91,6 @@ runs: if [[ ${{ inputs.trigger }} == "develop" ]] && [[ ${{ inputs.type }} == 'official' ]]; then bundle exec fastlane android official_open_testing fi - shell: bash - name: Leave a comment on PR diff --git a/.github/actions/upload-ios/action.yml b/.github/actions/upload-ios/action.yml index 68f5d4539d4..66db9bf59ef 100644 --- a/.github/actions/upload-ios/action.yml +++ b/.github/actions/upload-ios/action.yml @@ -109,6 +109,11 @@ runs: yarn pod-install shell: bash + - uses: actions/download-artifact@v4 + with: + name: release-changelog + path: . + - name: Fastlane Submit to TestFlight working-directory: ios run: | diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index 48ffc62e564..b8be5d7ef33 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -14,11 +14,16 @@ jobs: if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/eslint.yml + generate-changelog: + name: Generate Release Changelog + needs: [run-eslint-and-test] + uses: ./.github/workflows/generate-changelog.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] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: experimental @@ -28,7 +33,7 @@ jobs: name: Build Android Official if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/build-official-android.yml - needs: [run-eslint-and-test] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: official @@ -38,7 +43,7 @@ jobs: name: Build iOS Experimental if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/build-ios.yml - needs: [run-eslint-and-test] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: experimental @@ -48,7 +53,7 @@ jobs: name: Build iOS Official if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/build-official-ios.yml - needs: [run-eslint-and-test] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: official diff --git a/.github/workflows/build-official-android.yml b/.github/workflows/build-official-android.yml index 76d195085b0..4f387ec6bad 100644 --- a/.github/workflows/build-official-android.yml +++ b/.github/workflows/build-official-android.yml @@ -73,7 +73,7 @@ jobs: name: Upload runs-on: ubuntu-latest needs: [upload-hold] - if: ${{ inputs.type == 'official' && (always() && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped')) }} + if: ${{ inputs.type == 'official' && inputs.trigger == 'pr' }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -91,7 +91,7 @@ jobs: name: Internal Sharing runs-on: ubuntu-latest needs: [build-android] - if: ${{ inputs.type == 'official' && inputs.trigger == 'pr' }} + 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-pr.yml b/.github/workflows/build-pr.yml index 9871d27b04d..134890bcf70 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -9,21 +9,22 @@ on: branches: - '*' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: run-eslint-and-test: name: ESLint and Test if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/eslint.yml + generate-changelog: + name: Generate Release Changelog + needs: [run-eslint-and-test] + uses: ./.github/workflows/generate-changelog.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] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: experimental @@ -33,7 +34,7 @@ jobs: name: Build Android Official if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/build-official-android.yml - needs: [run-eslint-and-test] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: official @@ -43,7 +44,7 @@ jobs: name: Build iOS Experimental if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/build-ios.yml - needs: [run-eslint-and-test] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: experimental @@ -53,7 +54,7 @@ jobs: name: Build iOS Official if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }} uses: ./.github/workflows/build-official-ios.yml - needs: [run-eslint-and-test] + needs: [run-eslint-and-test, generate-changelog] secrets: inherit with: type: official diff --git a/.github/workflows/generate-changelog.yml b/.github/workflows/generate-changelog.yml new file mode 100644 index 00000000000..ab2c617f8c2 --- /dev/null +++ b/.github/workflows/generate-changelog.yml @@ -0,0 +1,32 @@ +name: Generate Release Changelog + +on: + workflow_call: + +jobs: + generate-changelog: + name: Generate changelog + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate changelog + shell: bash + run: | + LATEST_RELEASE_TAG=$(git tag --sort=-creatordate | head -n 1) + + git log "$LATEST_RELEASE_TAG"..HEAD --pretty=format:"- %s" --no-merges > changelog.txt + + if [ ! -s changelog.txt ]; then + echo "- Improvements and bug fixes" > changelog.txt + fi + + - name: Upload changelog artifact + uses: actions/upload-artifact@v4 + with: + name: release-changelog + path: changelog.txt diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index b89435389ce..1448a1173f0 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -78,7 +78,11 @@ platform :android do upload_to_play_store( package_name: 'chat.rocket.android', track: 'beta', - aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab' + aab: 'app/build/outputs/bundle/officialRelease/app-official-release.aab', + skip_upload_metadata: true, + skip_upload_changelogs: false, + skip_upload_images: true, + skip_upload_screenshots: true ) end end diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 80a43c7f587..bee5766f08c 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -29,6 +29,15 @@ platform :ios do desc "Submit a new Beta Build to Apple TestFlight" lane :beta do |options| + changelog_path = File.expand_path('../../changelog.txt', __dir__) + + changelog = if File.exist?(changelog_path) + content = File.read(changelog_path) + content.length > 4000 ? content[0, 3997] + "..." : content + else + "Improvements and bug fixes" + end + 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"], @@ -38,7 +47,9 @@ platform :ios do pilot( ipa: 'Rocket.Chat.ipa', app_identifier: options[:official] ? 'chat.rocket.ios' : 'chat.rocket.reactnative', - skip_waiting_for_build_processing: true + skip_waiting_for_build_processing: true, + reject_build_waiting_for_review: true, + changelog: changelog ) upload_symbols_to_crashlytics(dsym_path: "Rocket.Chat.app.dSYM.zip") upload_symbols_to_bugsnag(