Skip to content

Commit

Permalink
TestFlight refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed Dec 9, 2020
1 parent 81c9b8b commit 520e5e3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 67 deletions.
57 changes: 34 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -479,7 +490,7 @@ workflows:
# type: approval
# requires:
# - ios-build-official
- ios-testflight:
- ios-testflight-official:
requires:
- ios-build-official

Expand Down
51 changes: 7 additions & 44 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@ 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",
key_filepath: 'fastlane/app_store_connect_api_key.p8',
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",
Expand All @@ -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',
Expand All @@ -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|
Expand Down

0 comments on commit 520e5e3

Please sign in to comment.