File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ default_platform(:ios)
66PLIST_KEY = "CFBundleShortVersionString"
77
88platform :ios do
9+ before_all do
10+ # Perform a fetch before inferring the next version
11+ # to reduce race conditions with simultaneous pipelines attempting to create the same tag
12+ sh ( 'git' , 'fetch' , '--tags' )
13+ sh ( 'git' , 'fetch' )
14+ end
915 desc "Create a pre-release version by pushing a tag to GitHub, and pushing pods to CocoaPods"
1016 lane :unstable do
1117 next_version = calculate_next_canary_version
@@ -104,8 +110,8 @@ platform :ios do
104110 with_retry do
105111 begin
106112 pod_push ( path : pod [ :spec ] , allow_warnings : true , synchronous : true )
107- rescue exception
108- raise exception unless exception . message =~ /Unable to accept duplicate entry/i
113+ rescue StandardError => e
114+ raise e unless e . message =~ /Unable to accept duplicate entry/i
109115 UI . warn ( "Version already exists. Ignoring" )
110116 end
111117 end
@@ -146,13 +152,13 @@ platform :ios do
146152 end
147153end
148154
149- def with_retry ( retries = 5 , wait = 10 )
155+ def with_retry ( retries = 5 , wait = 60 )
150156 begin
151157 yield
152- rescue e
158+ rescue StandardError => e
153159 retries -= 1
154160 raise e if retries . zero?
155- UI . error ( "Error occurred: #{ exception } ; retrying..." )
161+ UI . error ( "Error occurred: #{ e } ; retrying..." )
156162 sleep ( wait )
157163 retry
158164 end
You can’t perform that action at this time.
0 commit comments