Skip to content

Commit a46aa2b

Browse files
[CI] Add snapshot version postfix (#3489)
1 parent 24f8e19 commit a46aa2b

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.70)
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)
@@ -437,7 +437,7 @@ DEPENDENCIES
437437
fastlane-plugin-create_xcframework
438438
fastlane-plugin-lizard
439439
fastlane-plugin-sonarcloud_metric_kit
440-
fastlane-plugin-stream_actions (= 0.3.70)
440+
fastlane-plugin-stream_actions (= 0.3.76)
441441
fastlane-plugin-versioning
442442
jazzy
443443
json

Sources/StreamChat/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
extension 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
@@ -66,7 +66,7 @@ lane :release do |options|
6666
File.write(artifacts_path, JSON.dump(artifacts))
6767

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

7272
# Update sdk sizes
@@ -93,11 +93,17 @@ end
9393

9494
lane :merge_main do
9595
merge_main_to_develop
96+
current_version = get_sdk_version_from_environment
97+
add_snapshot_to_current_version(file_path: swift_environment_path)
98+
ensure_git_branch(branch: 'develop')
99+
sh("git add #{swift_environment_path}")
100+
sh("git commit -m 'Add snapshot postfix to v#{current_version}'")
101+
sh('git push')
96102
end
97103

98104
desc 'Completes an SDK Release'
99105
lane :publish_release do |options|
100-
release_version = File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+)"/)[1]
106+
release_version = get_sdk_version_from_environment
101107
UI.user_error!("Release #{release_version} has already been published.") if git_tag_exists(tag: release_version, remote: true)
102108
UI.user_error!('Release version cannot be empty') if release_version.to_s.empty?
103109
ensure_git_branch(branch: 'main')
@@ -120,6 +126,10 @@ lane :publish_release do |options|
120126
update_spm(version: release_version)
121127
end
122128

129+
lane :get_sdk_version_from_environment do
130+
File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+).*"/)[1]
131+
end
132+
123133
desc 'Compresses the XCFrameworks into zip files'
124134
lane :compress_frameworks do
125135
Dir.chdir('..') do

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-create_xcframework'
77
gem 'fastlane-plugin-sonarcloud_metric_kit'
8-
gem 'fastlane-plugin-stream_actions', '0.3.70'
8+
gem 'fastlane-plugin-stream_actions', '0.3.76'

0 commit comments

Comments
 (0)