@@ -83,6 +83,9 @@ lane :release do |options|
83
83
# Set the framework version in SystemEnvironment+Version.swift
84
84
new_content = File . read ( swift_environment_path ) . gsub! ( previous_version_number , release_version )
85
85
File . open ( swift_environment_path , 'w' ) { |f | f . puts ( new_content ) }
86
+
87
+ # Update sdk sizes
88
+ Dir . chdir ( 'fastlane' ) { update_img_shields_sdk_sizes }
86
89
end
87
90
88
91
pod_lint
@@ -542,6 +545,27 @@ lane :show_frameworks_sizes do |options|
542
545
UI . user_error! ( "#{ table_header } benchmark failed." ) if markdown_table . include? ( fail_status )
543
546
end
544
547
548
+ desc 'Update img shields SDK size labels'
549
+ lane :update_img_shields_sdk_sizes do
550
+ sizes = frameworks_sizes
551
+
552
+ # Read the file into a string
553
+ readme_path = '../README.md'
554
+ readme_content = File . read ( readme_path )
555
+
556
+ # Define the new value for the badge
557
+ stream_chat_swiftui_size = "#{ sizes [ :StreamChatSwiftUI ] } MB"
558
+
559
+ # Replace the value in the badge URL
560
+ readme_content . gsub! ( %r{(https://img.shields.io/badge/StreamChatSwiftUI-)(.*?)(-blue)} , "\\ 1#{ stream_chat_swiftui_size } \\ 3" )
561
+
562
+ # Write the updated content back to the file
563
+ File . write ( readme_path , readme_content )
564
+
565
+ # Notify success
566
+ UI . success ( 'Successfully updated the SDK size labels in README.md!' )
567
+ end
568
+
545
569
def frameworks_sizes
546
570
root_dir = 'Build/SDKSize'
547
571
archive_dir = "#{ root_dir } /DemoApp.xcarchive"
0 commit comments