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)
6
6
PLIST_KEY = "CFBundleShortVersionString"
7
7
8
8
platform :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
9
15
desc "Create a pre-release version by pushing a tag to GitHub, and pushing pods to CocoaPods"
10
16
lane :unstable do
11
17
next_version = calculate_next_canary_version
@@ -104,8 +110,8 @@ platform :ios do
104
110
with_retry do
105
111
begin
106
112
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
109
115
UI . warn ( "Version already exists. Ignoring" )
110
116
end
111
117
end
@@ -146,13 +152,13 @@ platform :ios do
146
152
end
147
153
end
148
154
149
- def with_retry ( retries = 5 , wait = 10 )
155
+ def with_retry ( retries = 5 , wait = 60 )
150
156
begin
151
157
yield
152
- rescue e
158
+ rescue StandardError => e
153
159
retries -= 1
154
160
raise e if retries . zero?
155
- UI . error ( "Error occurred: #{ exception } ; retrying..." )
161
+ UI . error ( "Error occurred: #{ e } ; retrying..." )
156
162
sleep ( wait )
157
163
retry
158
164
end
You can’t perform that action at this time.
0 commit comments