Skip to content

Commit

Permalink
[CI] Add snapshot version postfix (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple authored Nov 15, 2024
1 parent 894bb76 commit bb9c4ec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
14 changes: 12 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit bb9c4ec

Please sign in to comment.