@@ -19,6 +19,7 @@ RELEASE_NOTES_PATH = File.join(RESOURCES_FOLDER, 'release_notes.txt')
1919FASTLANE_DIR = __dir__
2020DERIVED_DATA_DIR = File . join ( FASTLANE_DIR , 'DerivedData' )
2121SCREENSHOTS_DIR = File . join ( FASTLANE_DIR , 'screenshots' )
22+ FASTLANE_METADATA_FOLDER = File . join ( FASTLANE_DIR , 'metadata' )
2223WORKSPACE_PATH = File . join ( PROJECT_ROOT_FOLDER , 'WooCommerce.xcworkspace' )
2324IOS_LOCALES = %w[ ar de-DE en-US es-ES fr-FR he id it ja ko nl-NL pt-BR ru sv tr zh-Hans zh-Hant ] . freeze
2425SIMULATOR_VERSION = '15.5' # For screenshots
@@ -185,8 +186,14 @@ platform :ios do
185186 extracted_notes_file_path : RELEASE_NOTES_PATH )
186187 )
187188 ios_update_release_notes ( new_version : new_version )
188- setbranchprotection ( repository : GITHUB_REPO , branch : "release/#{ new_version } " )
189- setfrozentag ( repository : GITHUB_REPO , milestone : new_version )
189+ setbranchprotection (
190+ repository : GITHUB_REPO ,
191+ branch : "release/#{ new_version } "
192+ )
193+ setfrozentag (
194+ repository : GITHUB_REPO ,
195+ milestone : new_version
196+ )
190197 ios_check_beta_deps ( podfile : File . join ( PROJECT_ROOT_FOLDER , 'Podfile' )
191198 end
192199
@@ -221,7 +228,7 @@ platform :ios do
221228 #
222229 desc 'Updates the AppStoreStrings.pot file with the latest data'
223230 lane :update_appstore_strings do |options |
224- source_metadata_folder = File . join ( PROJECT_ROOT_FOLDER , 'fastlane' , 'appstoreres' , 'metadata' , 'source' )
231+ source_metadata_folder = File . join ( FASTLANE_DIR , 'appstoreres' , 'metadata' , 'source' )
225232
226233 files = {
227234 whats_new : RELEASE_NOTES_PATH ,
@@ -284,7 +291,10 @@ platform :ios do
284291 desc 'Creates a new hotfix branch for the given version:x.y.z. The branch will be cut from the tag x.y of the previous release'
285292 lane :new_hotfix_release do |options |
286293 prev_ver = ios_hotfix_prechecks ( options )
287- ios_bump_version_hotfix ( previous_version : prev_ver , version : options [ :version ] )
294+ ios_bump_version_hotfix (
295+ previous_version : prev_ver ,
296+ version : options [ :version ]
297+ )
288298 end
289299
290300 #####################################################################################
@@ -344,10 +354,25 @@ platform :ios do
344354
345355 # Wrap up
346356 version = ios_get_app_version
347- removebranchprotection ( repository : GITHUB_REPO , branch : "release/#{ version } " )
348- setfrozentag ( repository : GITHUB_REPO , milestone : version , freeze : false )
349- create_new_milestone ( repository : GITHUB_REPO , need_appstore_submission : true , milestone_duration : 7 , number_of_days_from_code_freeze_to_release : 10 )
350- close_milestone ( repository : GITHUB_REPO , milestone : version )
357+ removebranchprotection (
358+ repository : GITHUB_REPO ,
359+ branch : "release/#{ version } "
360+ )
361+ setfrozentag (
362+ repository : GITHUB_REPO ,
363+ milestone : version ,
364+ freeze : false
365+ )
366+ create_new_milestone (
367+ repository : GITHUB_REPO ,
368+ need_appstore_submission : true ,
369+ milestone_duration : 7 ,
370+ number_of_days_from_code_freeze_to_release : 10
371+ )
372+ close_milestone (
373+ repository : GITHUB_REPO ,
374+ milestone : version
375+ )
351376
352377 # Start the build
353378 trigger_release_build ( branch_to_build : "release/#{ version } " )
@@ -369,10 +394,18 @@ platform :ios do
369394 #####################################################################################
370395 desc 'Builds and uploads for distribution'
371396 lane :build_and_upload_beta do |options |
372- ios_build_prechecks ( skip_confirm : options [ :skip_confirm ] , internal : false , external : true )
397+ ios_build_prechecks (
398+ skip_confirm : options [ :skip_confirm ] ,
399+ internal : false ,
400+ external : true
401+ )
373402 ios_build_preflight
374- build_and_upload_itc ( skip_prechecks : true , skip_confirm : options [ :skip_confirm ] , beta_release : true ,
375- create_release : options [ :create_gh_release ] )
403+ build_and_upload_itc (
404+ skip_prechecks : true ,
405+ skip_confirm : options [ :skip_confirm ] ,
406+ beta_release : true ,
407+ create_release : options [ :create_gh_release ]
408+ )
376409 end
377410
378411 #####################################################################################
@@ -391,10 +424,18 @@ platform :ios do
391424 #####################################################################################
392425 desc 'Builds and uploads for distribution'
393426 lane :build_and_upload_release do |options |
394- ios_build_prechecks ( skip_confirm : options [ :skip_confirm ] , internal : false , external : true )
427+ ios_build_prechecks (
428+ skip_confirm : options [ :skip_confirm ] ,
429+ internal : false ,
430+ external : true
431+ )
395432 ios_build_preflight
396- build_and_upload_itc ( skip_prechecks : true , skip_confirm : options [ :skip_confirm ] , beta_release : false ,
397- create_release : options [ :create_gh_release ] )
433+ build_and_upload_itc (
434+ skip_prechecks : true ,
435+ skip_confirm : options [ :skip_confirm ] ,
436+ beta_release : false ,
437+ create_release : options [ :create_gh_release ]
438+ )
398439 end
399440
400441 #####################################################################################
@@ -407,7 +448,10 @@ platform :ios do
407448 #
408449 #####################################################################################
409450 lane :trigger_beta_build do |options |
410- trigger_buildkite_release_build ( branch : options [ :branch_to_build ] , beta : true )
451+ trigger_buildkite_release_build (
452+ branch : options [ :branch_to_build ] ,
453+ beta : true
454+ )
411455 end
412456
413457 #####################################################################################
@@ -420,7 +464,10 @@ platform :ios do
420464 #
421465 #####################################################################################
422466 lane :trigger_release_build do |options |
423- trigger_buildkite_release_build ( branch : options [ :branch_to_build ] , beta : false )
467+ trigger_buildkite_release_build (
468+ branch : options [ :branch_to_build ] ,
469+ beta : false
470+ )
424471 end
425472
426473 #####################################################################################
@@ -442,7 +489,10 @@ platform :ios do
442489 ensure_sentry_installed
443490
444491 unless options [ :skip_prechecks ]
445- ios_build_prechecks ( skip_confirm : options [ :skip_confirm ] , external : true )
492+ ios_build_prechecks (
493+ skip_confirm : options [ :skip_confirm ] ,
494+ external : true
495+ )
446496 ios_build_preflight
447497 xcversion # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
448498 end
@@ -476,11 +526,13 @@ platform :ios do
476526 zip ( path : lane_context [ SharedValues ::XCODEBUILD_ARCHIVE ] , output_path : archive_zip_path )
477527
478528 version = options [ :beta_release ] ? ios_get_build_version : ios_get_app_version
479- create_release ( repository : GITHUB_REPO ,
480- version : version ,
481- release_notes_file_path : RELEASE_NOTES_PATH ,
482- release_assets : archive_zip_path . to_s ,
483- prerelease : options [ :beta_release ] )
529+ create_release (
530+ repository : GITHUB_REPO ,
531+ version : version ,
532+ release_notes_file_path : RELEASE_NOTES_PATH ,
533+ release_assets : archive_zip_path . to_s ,
534+ prerelease : options [ :beta_release ]
535+ )
484536
485537 sh ( "rm #{ archive_zip_path } " )
486538 end
@@ -777,7 +829,7 @@ platform :ios do
777829
778830 desc 'Downloads localized metadata for App Store Connect from GlotPress'
779831 lane :download_localized_metadata_from_glotpress do
780- metadata_directory = File . join ( PROJECT_ROOT_FOLDER , 'fastlane' , 'metadata' )
832+ metadata_directory = FASTLANE_METADATA_FOLDER
781833
782834 # FIXME: We should make the `fastlane/metadata/default/release_notes.txt` path be the source of truth for the original copies in the future.
783835 # (will require changes in the `update_appstore_strings` lane, the Release Scenario, the MC tool to generate the announcement post…)
@@ -823,7 +875,10 @@ platform :ios do
823875 end
824876
825877 # Commit
826- git_add ( path : files_to_commit , shell_escape : false )
878+ git_add (
879+ path : files_to_commit ,
880+ shell_escape : false
881+ )
827882 git_commit (
828883 path : files_to_commit ,
829884 message : 'Update metadata translations' ,
@@ -855,11 +910,13 @@ platform :ios do
855910
856911 metadata_locales = GLOTPRESS_TO_ASC_METADATA_LOCALE_CODES
857912
858- gp_downloadmetadata ( project_url : GLOTPRESS_APP_STORE_METADATA_PROJECT_URL ,
859- target_files : files ,
860- locales : metadata_locales ,
861- source_locale : 'en-US' ,
862- download_path : './fastlane/metadata' )
913+ gp_downloadmetadata (
914+ project_url : GLOTPRESS_APP_STORE_METADATA_PROJECT_URL ,
915+ target_files : files ,
916+ locales : metadata_locales ,
917+ source_locale : 'en-US' ,
918+ download_path : FASTLANE_METADATA_FOLDER
919+ )
863920
864921 # Copy appstoreres (screenshot-related) txt files into `en-US`
865922 en_us_path = File . join ( Dir . pwd , 'metadata' , 'en-US' )
@@ -1077,7 +1134,10 @@ lane :test_without_building do |options|
10771134 fail_build : false
10781135 )
10791136
1080- trainer ( path : lane_context [ SharedValues ::SCAN_GENERATED_XCRESULT_PATH ] , fail_build : true )
1137+ trainer (
1138+ path : lane_context [ SharedValues ::SCAN_GENERATED_XCRESULT_PATH ] ,
1139+ fail_build : true
1140+ )
10811141end
10821142
10831143# -----------------------------------------------------------------------------------
0 commit comments