From 520e5e33abaf9c8d9f89d6baa9fb2a63cfe78004 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 9 Dec 2020 11:27:27 -0300 Subject: [PATCH] TestFlight refactor --- .circleci/config.yml | 57 ++++++++++++++++++++++++++----------------- ios/fastlane/Fastfile | 51 ++++++-------------------------------- 2 files changed, 41 insertions(+), 67 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d2f999d79e..8c8717c23c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,6 +75,27 @@ restore_cache: &restore-gradle-cache name: Restore gradle cache key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }} +# COMMANDS +commands: + upload-to-testflight: + description: "Upload to testlight" + parameters: + official: + type: boolean + steps: + - checkout + - attach_workspace: + at: ios + - restore_cache: *restore-gems-cache + - run: *update-fastlane-ios + - run: + name: Fastlane Tesflight Upload + command: | + echo $APP_STORE_CONNECT_API_KEY | base64 --decode > ./fastlane/app_store_connect_api_key.p8 + bundle exec fastlane ios beta official:<< parameters.official >> + working_directory: ios + - save_cache: *save-gems-cache + version: 2.1 # EXECUTORS @@ -365,28 +386,6 @@ jobs: - ios/*.ipa - ios/fastlane/report.xml - ios-testflight: - executor: mac-env - - steps: - - checkout - - - attach_workspace: - at: ios - - - restore_cache: *restore-gems-cache - - - run: *update-fastlane-ios - - - run: - name: Fastlane Tesflight Upload - command: | - echo $APP_STORE_CONNECT_API_KEY | base64 --decode > ./fastlane/app_store_connect_api_key.p8 - bundle exec fastlane ios beta - working_directory: ios - - - save_cache: *save-gems-cache - ios-build-official: executor: mac-env @@ -451,6 +450,18 @@ jobs: - ios/*.ipa - ios/fastlane/report.xml + ios-testflight: + executor: mac-env + steps: + - upload-to-testflight: + official: false + + ios-testflight-official: + executor: mac-env + steps: + - upload-to-testflight: + official: true + workflows: build-and-test: jobs: @@ -479,7 +490,7 @@ workflows: # type: approval # requires: # - ios-build-official - - ios-testflight: + - ios-testflight-official: requires: - ios-build-official diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 7b294c5a964..55a30a20dfc 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -31,7 +31,7 @@ platform :ios do end desc "Submit a new Beta Build to Apple TestFlight" - lane :beta do + lane :beta do |options| api_key = app_store_connect_api_key( key_id: "F296L2294Y", issuer_id: "69a6de8e-75cf-47e3-e053-5b8c7c11a4d1", @@ -39,12 +39,13 @@ platform :ios do in_house: false ) pilot( - # ipa: 'ios/RocketChatRN.ipa', + ipa: options[:official] ? 'Rocket.Chat.ipa' : 'ios/RocketChatRN.ipa', + app_identifier: options[:official] ? 'chat.rocket.ios' : 'chat.rocket.reactnative', skip_waiting_for_build_processing: true ) end - desc "Build App for release" + desc "Build Experimental app for release" lane :release do api_key = app_store_connect_api_key( key_id: "F296L2294Y", @@ -64,33 +65,16 @@ platform :ios do gym(scheme: "RocketChatRN", workspace: "RocketChatRN.xcworkspace", skip_codesigning: true, skip_archive: true) end - desc "Build official" + desc "Build Official app for release" lane :build_official do sh "../../scripts/prepare_ios_official.sh" - # update_code_signing_settings( - # path: "RocketChatRN.xcodeproj", - # use_automatic_signing: true, - # targets: ["Rocket.Chat", "NotificationService", "ShareRocketChatRN"], - # profile_name: '', - # code_sign_identity: 'iPhone Developer' - # ) - + match( type: "appstore", app_identifier: ["chat.rocket.ios", "chat.rocket.ios.NotificationService", "chat.rocket.ios.Rocket-Chat-ShareExtension"], readonly: true, output_path: './' ) - # get_provisioning_profile(app_identifier: "chat.rocket.ios.Rocket-Chat-ShareExtension") - # get_provisioning_profile(app_identifier: "chat.rocket.ios.NotificationService") - - # build_app(scheme: "RocketChat", workspace: "RocketChatRN.xcworkspace", skip_profile_detection: true, export_xcargs: "-allowProvisioningUpdates") - - # settings_to_override = { - # :BUNDLE_IDENTIFIER => MY_APP_ID, - # :PROVISIONING_PROFILE_SPECIFIER => MY_PROFILE, - # :DEVELOPMENT_TEAM => MY_TEAM - # } update_project_provisioning( xcodeproj: 'RocketChatRN.xcodeproj', @@ -111,29 +95,8 @@ platform :ios do gym( scheme: "RocketChat", workspace: "RocketChatRN.xcworkspace", - xcargs: "-allowProvisioningUpdates", - # export_options: { - # provisioningProfiles: { - # # "chat.rocket.ios": '', - # "chat.rocket.NotificationService": 'match AppStore chat.rocket.ios.NotificationService', - # "chat.rocket.ios.Rocket-Chat-ShareExtension": 'match AppStore chat.rocket.ios.Rocket-Chat-ShareExtension', - # } - # } + xcargs: "-allowProvisioningUpdates" ) - # match(type: "development") - # build_app( - # scheme: "RocketChat", - # workspace: "RocketChatRN.xcworkspace", - # export_options: { - # method: "development", - # provisioningProfiles: { - # "chat.rocket.ios": '', - # "chat.rocket.NotificationService": '', - # "chat.rocket.ios.Rocket-Chat-ShareExtension": '', - # } - # } - # ) - # gym(scheme: "Rocket.Chat", workspace: "RocketChatRN.xcworkspace", skip_codesigning: true, skip_archive: true) end after_all do |lane|