From 04a7082d92c4c5c898e0ce28177d1de34b8df388 Mon Sep 17 00:00:00 2001 From: mlch911 Date: Sat, 14 May 2022 15:46:28 +0800 Subject: [PATCH] Update fastlane --- ios/fastlane/Fastfile | 53 +++++++++++++++++++++++++++++++++++------- ios/fastlane/README.md | 8 +++++++ 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 88a3ffe..5086ae5 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -28,14 +28,7 @@ platform :ios do lane :release do begin bump_build - build_ios_app( - workspace: ENV['WORKSPACE'], - configuration: 'Release', - scheme: ENV['SCHEME'], - clean: true, - xcargs: '-allowProvisioningUpdates', - include_symbols: true - ) + build_app app_store_connect_api_key( key_id: 'NFBM52M2PY', issuer_id: '22e070fb-ba6d-4f93-bf6f-1a6415f583fe', @@ -68,6 +61,50 @@ platform :ios do end end + lane :testflight do + ensure_git_status_clean + + begin + bump_build + build_app + + app_store_connect_api_key( + key_id: 'NFBM52M2PY', + issuer_id: '22e070fb-ba6d-4f93-bf6f-1a6415f583fe', + key_filepath: '~/AuthKey_NFBM52M2PY.p8', + duration: 1200, + in_house: false + ) + upload_to_testflight( + ipa: lane_context[:IPA_OUTPUT_PATH], + team_id: ENV['TEAM_ID'], + app_identifier: ENV['BUNDLE_ID'], + distribute_external: true, + changelog: '【优化】修复bug,优化体验', + notify_external_testers: true, + groups: ['dev', 'test'] + ) + + clean_build_artifacts + rescue => exception + revert_bump_build + clean_build_artifacts + `git checkout . && git clean -df` + raise exception + end + end + + private_lane :build_app do + build_ios_app( + workspace: ENV['WORKSPACE'], + configuration: 'Release', + scheme: ENV['SCHEME'], + clean: true, + xcargs: '-allowProvisioningUpdates', + include_symbols: true + ) + end + lane :bump_version do ensure_git_status_clean diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md index 8754d86..eacd6c0 100644 --- a/ios/fastlane/README.md +++ b/ios/fastlane/README.md @@ -23,6 +23,14 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do +### ios testflight + +```sh +[bundle exec] fastlane ios testflight +``` + + + ### ios bump_version ```sh