Skip to content

Commit

Permalink
Update to deploy HybridApp to production
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGable committed Nov 11, 2024
1 parent 0f2272e commit 53416c8
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}"
Expand Down
94 changes: 94 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

0 comments on commit 53416c8

Please sign in to comment.