From bb9c4ecea032305908f6df4a93eb4a3c924458ad Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Fri, 15 Nov 2024 10:04:08 +0000 Subject: [PATCH] [CI] Add snapshot version postfix (#603) --- Gemfile.lock | 4 ++-- .../Generated/SystemEnvironment+Version.swift | 2 +- fastlane/Fastfile | 14 ++++++++++++-- fastlane/Pluginfile | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 70a45a38f..febc0080d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -203,7 +203,7 @@ GEM bundler fastlane pry - fastlane-plugin-stream_actions (0.3.70) + fastlane-plugin-stream_actions (0.3.76) xctest_list (= 1.2.1) fastlane-plugin-versioning (0.6.0) ffi (1.17.0) @@ -430,7 +430,7 @@ DEPENDENCIES fastlane fastlane-plugin-create_xcframework fastlane-plugin-lizard - fastlane-plugin-stream_actions (= 0.3.70) + fastlane-plugin-stream_actions (= 0.3.76) fastlane-plugin-versioning jazzy json diff --git a/Sources/StreamVideo/Generated/SystemEnvironment+Version.swift b/Sources/StreamVideo/Generated/SystemEnvironment+Version.swift index 561f28cba..5d58e32dc 100644 --- a/Sources/StreamVideo/Generated/SystemEnvironment+Version.swift +++ b/Sources/StreamVideo/Generated/SystemEnvironment+Version.swift @@ -7,7 +7,7 @@ import Foundation extension SystemEnvironment { /// A Stream Video version. - public static let version: String = "1.14.1" + public static let version: String = "1.14.1-SNAPSHOT" /// The WebRTC version. public static let webRTCVersion: String = "114.5735.8" } diff --git a/fastlane/Fastfile b/fastlane/Fastfile index a516d49b2..a85822165 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -51,7 +51,7 @@ lane :release do |options| File.write(artifacts_path, JSON.dump(artifacts)) # Set the framework version in SystemEnvironment+Version.swift - new_content = File.read(swift_environment_path).gsub!(previous_version_number, release_version) + new_content = File.read(swift_environment_path).gsub!(previous_version_number, release_version).gsub!('-SNAPSHOT', '') File.open(swift_environment_path, 'w') { |f| f.puts(new_content) } # Update sdk sizes @@ -77,11 +77,17 @@ end lane :merge_main do merge_main_to_develop + current_version = get_sdk_version_from_environment + add_snapshot_to_current_version(file_path: swift_environment_path) + ensure_git_branch(branch: 'develop') + sh("git add #{swift_environment_path}") + sh("git commit -m 'Add snapshot postfix to v#{current_version}'") + sh('git push') end desc "Publish a new release to GitHub and CocoaPods" lane :publish_release do |options| - release_version = File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+)"/)[1] + release_version = get_sdk_version_from_environment UI.user_error!("Release #{release_version} has already been published.") if git_tag_exists(tag: release_version, remote: true) UI.user_error!('Release version cannot be empty') if release_version.to_s.empty? ensure_git_branch(branch: 'main') @@ -104,6 +110,10 @@ lane :publish_release do |options| update_spm(version: release_version) end +lane :get_sdk_version_from_environment do + File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+).*"/)[1] +end + lane :pod_lint do # We don't lint StreamVideoSwiftUI and StreamVideoUIKit podspecs since pod lints them against StreamVideo's remote version instead of local one pod_lib_lint(podspec: 'StreamVideo.podspec', allow_warnings: true) diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 28209fbe4..21b4ffb69 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -1,3 +1,3 @@ gem 'fastlane-plugin-versioning' gem 'fastlane-plugin-create_xcframework' -gem 'fastlane-plugin-stream_actions', '0.3.70' +gem 'fastlane-plugin-stream_actions', '0.3.76'