@@ -16,6 +16,7 @@ source_packages_path = 'spm_cache'
16
16
buildcache_xcargs = 'CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++'
17
17
is_localhost = !is_ci
18
18
project_package_resolved = "#{ xcode_project } /project.xcworkspace/xcshareddata/swiftpm/Package.resolved"
19
+ swift_environment_path = File . absolute_path ( '../Sources/StreamChatSwiftUI/Generated/SystemEnvironment+Version.swift' )
19
20
@force_check = false
20
21
21
22
before_all do |lane |
@@ -67,7 +68,6 @@ desc 'Release a new version'
67
68
lane :release do |options |
68
69
previous_version_number = last_git_tag
69
70
artifacts_path = File . absolute_path ( '../StreamChatSwiftUIArtifacts.json' )
70
- swift_environment_path = File . absolute_path ( '../Sources/StreamChatSwiftUI/Generated/SystemEnvironment+Version.swift' )
71
71
extra_changes = lambda do |release_version |
72
72
# Set the framework version on the artifacts
73
73
artifacts = JSON . parse ( File . read ( artifacts_path ) )
@@ -100,23 +100,27 @@ end
100
100
101
101
desc "Publish a new release to GitHub and CocoaPods"
102
102
lane :publish_release do |options |
103
- xcversion ( version : '15.0.1' )
103
+ release_version = File . read ( swift_environment_path ) . match ( /String\s +=\s +"([\d .]+)"/ ) [ 1 ]
104
+ UI . user_error! ( "Release #{ release_version } has already been published." ) if git_tag_exists ( tag : release_version , remote : true )
105
+ UI . user_error! ( 'Release version cannot be empty' ) if release_version . to_s . empty?
106
+ ensure_git_branch ( branch : 'main' )
104
107
108
+ xcversion ( version : '15.0.1' )
105
109
clean_products
106
110
build_xcframeworks
107
111
compress_frameworks
108
112
clean_products
109
113
110
114
publish_ios_sdk (
111
115
skip_git_status_check : false ,
112
- version : options [ :version ] ,
116
+ version : release_version ,
113
117
sdk_names : sdk_names ,
114
118
podspec_names : [ 'StreamChatSwiftUI' , 'StreamChatSwiftUI-XCFramework' ] ,
115
119
github_repo : github_repo ,
116
120
upload_assets : [ 'Products/StreamChatSwiftUI.zip' ]
117
121
)
118
122
119
- update_spm ( version : options [ :version ] )
123
+ update_spm ( version : release_version )
120
124
121
125
merge_main_to_develop
122
126
end
0 commit comments