From 5f03987a4fa1bdb591c3da1261cd94b5e4f257bc Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Mon, 9 Dec 2024 12:07:32 +0000 Subject: [PATCH 1/2] [CI] Create a lane to update StreamChat dependency --- Package.swift | 2 +- fastlane/Fastfile | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 45e6b6fa..08e4bf6d 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.67.0"), + .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.68.0"), ], targets: [ .target( diff --git a/fastlane/Fastfile b/fastlane/Fastfile index fa1a516d..a7f5de82 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -146,6 +146,40 @@ private_lane :appstore_api_key do ) end +desc "Updates StreamChat dependency locally. Usage: `bundle exec fastlane update_stream_chat version:4.56.0`" +lane :update_stream_chat do |options| + raise UI.user_error!('Provide a version.') unless options[:version] + + Dir.chdir('..') do + file = 'Package.swift' + current_stream_chat_version = File.read(file)[/stream-chat-swift\.git", from: "([\d.]+)"\)/, 1] + File.write(file, File.read(file).gsub(/(stream-chat-swift\.git", from: ")[\d.]+"/, "\\1#{options[:version]}\"")) + + file = 'StreamChatSwiftUI-XCFramework.podspec' + File.write(file, File.read(file).gsub(/(StreamChat-XCFramework', '~> )[\d.]+'/, "\\1#{options[:version]}'")) + + file = 'StreamChatSwiftUI.podspec' + File.write(file, File.read(file).gsub(/(StreamChat', '~> )[\d.]+'/, "\\1#{options[:version]}'")) + + file = 'StreamChatSwiftUI.xcodeproj/project.pbxproj' + content = File.read(file) + if content.include?("minimumVersion = #{current_stream_chat_version}") + File.write(file, content.gsub("minimumVersion = #{current_stream_chat_version}", "minimumVersion = #{options[:version]}")) + elsif content.include?('branch = develop') + File.write(file, content.gsub('kind = branch', "minimumVersion = #{options[:version]}").gsub('branch = develop', 'kind = upToNextMajorVersion')) + else + UI.user_error!("Something went wrong after trying to modify #{file}.") + end + end + + pr_create( + title: "Update StreamChat dependency to #{options[:version]}", + base_branch: 'develop', + head_branch: "ci/update-stream-chat-dependency-#{Time.now.to_i}", + github_repo: github_repo + ) +end + lane :pod_lint do lint_required = true Dir.chdir('..') do From fefd3e461248a07a8fe1c3c7c6537ef4fcccbaa8 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Mon, 9 Dec 2024 12:13:22 +0000 Subject: [PATCH 2/2] Update StreamChat dependency to 4.69.0 --- Package.swift | 2 +- StreamChatSwiftUI-XCFramework.podspec | 2 +- StreamChatSwiftUI.podspec | 2 +- StreamChatSwiftUI.xcodeproj/project.pbxproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index 08e4bf6d..6e8e7b98 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.68.0"), + .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.69.0"), ], targets: [ .target( diff --git a/StreamChatSwiftUI-XCFramework.podspec b/StreamChatSwiftUI-XCFramework.podspec index d5966bc3..527dab78 100644 --- a/StreamChatSwiftUI-XCFramework.podspec +++ b/StreamChatSwiftUI-XCFramework.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |spec| spec.framework = 'Foundation', 'UIKit', 'SwiftUI' - spec.dependency 'StreamChat-XCFramework', '~> 4.68.0' + spec.dependency 'StreamChat-XCFramework', '~> 4.69.0' spec.cocoapods_version = '>= 1.11.0' end diff --git a/StreamChatSwiftUI.podspec b/StreamChatSwiftUI.podspec index fda38108..1adb6126 100644 --- a/StreamChatSwiftUI.podspec +++ b/StreamChatSwiftUI.podspec @@ -19,5 +19,5 @@ Pod::Spec.new do |spec| spec.framework = 'Foundation', 'UIKit', 'SwiftUI' - spec.dependency 'StreamChat', '~> 4.68.0' + spec.dependency 'StreamChat', '~> 4.69.0' end diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 1a73e0ab..96fbe65b 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -3824,7 +3824,7 @@ repositoryURL = "https://github.com/GetStream/stream-chat-swift.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 4.68.0; + minimumVersion = 4.69.0; }; }; E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {