Skip to content

Commit c840dff

Browse files
[CI] Add snapshot version postfix (#652)
1 parent c7f7f37 commit c840dff

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ GEM
200200
fastlane
201201
pry
202202
fastlane-plugin-sonarcloud_metric_kit (0.2.1)
203-
fastlane-plugin-stream_actions (0.3.71)
203+
fastlane-plugin-stream_actions (0.3.76)
204204
xctest_list (= 1.2.1)
205205
fastlane-plugin-versioning (0.6.0)
206206
ffi (1.17.0)
@@ -427,7 +427,7 @@ DEPENDENCIES
427427
fastlane-plugin-create_xcframework
428428
fastlane-plugin-lizard
429429
fastlane-plugin-sonarcloud_metric_kit
430-
fastlane-plugin-stream_actions (= 0.3.71)
430+
fastlane-plugin-stream_actions (= 0.3.76)
431431
fastlane-plugin-versioning
432432
jazzy
433433
json

Sources/StreamChatSwiftUI/Generated/SystemEnvironment+Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ import Foundation
77

88
enum SystemEnvironment {
99
/// A Stream Chat version.
10-
public static let version: String = "4.66.0"
10+
public static let version: String = "4.66.0-SNAPSHOT"
1111
}

fastlane/Fastfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ lane :release do |options|
7575
File.write(artifacts_path, JSON.dump(artifacts))
7676

7777
# Set the framework version in SystemEnvironment+Version.swift
78-
new_content = File.read(swift_environment_path).gsub!(previous_version_number, release_version)
78+
new_content = File.read(swift_environment_path).gsub!(previous_version_number, release_version).gsub!('-SNAPSHOT', '')
7979
File.open(swift_environment_path, 'w') { |f| f.puts(new_content) }
8080

8181
# Update sdk sizes
@@ -101,11 +101,17 @@ end
101101

102102
lane :merge_main do
103103
merge_main_to_develop
104+
current_version = get_sdk_version_from_environment
105+
add_snapshot_to_current_version(file_path: swift_environment_path)
106+
ensure_git_branch(branch: 'develop')
107+
sh("git add #{swift_environment_path}")
108+
sh("git commit -m 'Add snapshot postfix to v#{current_version}'")
109+
sh('git push')
104110
end
105111

106112
desc "Publish a new release to GitHub and CocoaPods"
107113
lane :publish_release do |options|
108-
release_version = File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+)"/)[1]
114+
release_version = get_sdk_version_from_environment
109115
UI.user_error!("Release #{release_version} has already been published.") if git_tag_exists(tag: release_version, remote: true)
110116
UI.user_error!('Release version cannot be empty') if release_version.to_s.empty?
111117
ensure_git_branch(branch: 'main')
@@ -128,6 +134,10 @@ lane :publish_release do |options|
128134
update_spm(version: release_version)
129135
end
130136

137+
lane :get_sdk_version_from_environment do
138+
File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+).*"/)[1]
139+
end
140+
131141
private_lane :appstore_api_key do
132142
@appstore_api_key ||= app_store_connect_api_key(
133143
key_id: 'MT3PRT8TB7',

fastlane/Pluginfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
gem 'fastlane-plugin-versioning'
66
gem 'fastlane-plugin-sonarcloud_metric_kit'
77
gem 'fastlane-plugin-create_xcframework'
8-
gem 'fastlane-plugin-stream_actions', '0.3.71'
8+
gem 'fastlane-plugin-stream_actions', '0.3.76'

0 commit comments

Comments
 (0)