From 53416c84e1f2bb7cc867c784e409a1ba4b489001 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 11 Nov 2024 14:34:20 -0700 Subject: [PATCH] Update to deploy HybridApp to production --- .github/workflows/deploy.yml | 17 +++++-- fastlane/Fastfile | 94 ++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d578621930a7..7d2cd666f18c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -167,8 +167,6 @@ jobs: name: Build and deploy Android HybridApp needs: prep runs-on: ubuntu-latest-xl - # Only deploy HybridApp to staging - if: ${{ github.ref == 'refs/heads/staging' }} defaults: run: working-directory: Mobile-Expensify/react-native @@ -260,10 +258,17 @@ jobs: ANDROID_UPLOAD_KEY_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }} - name: Upload Android app to Google Play + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} run: bundle exec fastlane android upload_google_play_internal_hybrid env: VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} + - name: Submit Android build for review + if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: bundle exec fastlane android upload_google_play_production_hybrid_rollout + env: + VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} + - name: Upload Android build to Browser Stack if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@${{ env.aabPath }}" @@ -477,8 +482,6 @@ jobs: runs-on: macos-13-xlarge env: DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer - # Only deploy HybridApp to staging - if: ${{ github.ref == 'refs/heads/staging' }} defaults: run: working-directory: Mobile-Expensify/react-native @@ -593,6 +596,12 @@ jobs: APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }} APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }} + - name: Submit production build for App Store review and a slow rollout + if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: bundle exec fastlane ios submit_hybrid_for_rollout + env: + VERSION: ${{ steps.getIOSVersion.outputs.IOS_VERSION }} + - name: Upload iOS build to Browser Stack if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@${{ env.ipaPath }}" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e90fdbe50255..c6d5bc08a153 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -236,6 +236,31 @@ platform :android do skip_upload_screenshots: true ) end + + desc "Deploy HybridApp to Google Play production at 1% rollout" + lane :upload_google_play_production_hybrid_rollout do + # Google is very unreliable, so we retry a few times + ENV["SUPPLY_UPLOAD_MAX_RETRIES"]="5" + google_play_track_version_codes( + package_name: "org.me.mobiexpensifyg", + json_key: './android/app/android-fastlane-json-key.json', + track: 'internal' + ) + upload_to_play_store( + package_name: "org.me.mobiexpensifyg", + json_key: './android/app/android-fastlane-json-key.json', + version_code: ENV["VERSION"].to_i, + track: 'internal', + track_promote_to: 'production', + rollout: '0.01', + skip_upload_apk: true, + skip_upload_aab: true, + skip_upload_metadata: true, + skip_upload_changelogs: true, + skip_upload_images: true, + skip_upload_screenshots: true + ) + end end def setupIOSSigningCertificate() @@ -519,4 +544,73 @@ platform :ios do } ) end + + desc "Submit HybridApp for production App Store slow rollout" + lane :submit_hybrid_for_rollout do + deliver( + app_identifier: "com.expensify.expensifylite", + api_key_path: "./ios/ios-fastlane-json-key.json", + + # Skip HTMl report verification + force: true, + + # VERSION will be set to the full build_number e.g. '1.0.92.0' + build_number: ENV["VERSION"], + + # app_version needs to be set to the short version, without the last digit e.g. '1.0.92' + app_version: ENV["VERSION"].rpartition(".")[0], + + # We want to submit the version for Apple to review + submit_for_review: true, + + # We want to release the app as soon as it's approved + automatic_release: true, + + # We want to enable a slow rollout + phased_release: true, + + # We need to upload metadata to upload the release notes which is required for rach new version + skip_metadata: false, + + # We do not want to upload any screenshots + skip_screenshots: true, + + # We do not have any binary to upload as it's already in TestFlight + skip_binary_upload: true, + + # Reject the current build if there is one in review + reject_if_possible: true, + + # We do not want to reset the ratings + reset_ratings: false, + + # Precheck cannot check for in app purchases with the API key we use + precheck_include_in_app_purchases: false, + submission_information: { + # We currently do not use idfa: https://developer.apple.com/app-store/user-privacy-and-data-use/ + add_id_info_uses_idfa: false, + + # We do not need any additional compliance + export_compliance_compliance_required: false, + + # We do not use any encrpytion + export_compliance_encryption_updated: false, + export_compliance_app_type: nil, + export_compliance_uses_encryption: false, + export_compliance_is_exempt: false, + export_compliance_contains_third_party_cryptography: false, + export_compliance_contains_proprietary_cryptography: false, + + # We do not show any third party content + content_rights_contains_third_party_content: false, + + # Indicate that our key has admin permissions + content_rights_has_rights: true + }, + release_notes: { + 'en-US' => "Improvements and bug fixes" + } + ) + end + end