5353# # ---- Extract OPTIMIZELY_SDK_VERSION from Xcode Build Settings. ----
5454printf " \n\n3. Extracting OPTIMIZELY_SDK_VERSION from Xcode Build Settings.\n\n" ;
5555OPTIMIZELY_SDK_VERSION=$( Xcodebuild -workspace OptimizelySDK.xcworkspace -scheme OptimizelySDKCoreiOS -showBuildSettings | sed -n ' s/OPTIMIZELY_SDK_VERSION = \(.*\)/\1/p' | sed ' s/ //g' ) ;
56- echo " OPTIMIZELY_SDK_VERSION = $OPTIMIZELY_SDK_VERSION " ;
56+ echo " OPTIMIZELY_SDK_VERSION = ${ OPTIMIZELY_SDK_VERSION} " ;
5757
5858# Make sure that OPTIMIZELY_SDK_VERSION looks correct!
5959printf " \n"
@@ -143,12 +143,21 @@ printf "the correct 'Target' branch. We expect you are tagging a commit\n"
143143printf " on a #.#.x branch.)\n"
144144read -n 1 -p " [y/n] $cr ? " tag_release;
145145if [ " $tag_release " == " y" ]; then
146- printf " Tagging $OPTIMIZELY_SDK_VERSION \n" ;
147- git tag -a $OPTIMIZELY_SDK_VERSION -m " Release $OPTIMIZELY_SDK_VERSION " ;
146+ printf " Tagging ${ OPTIMIZELY_SDK_VERSION} \n" ;
147+ git tag -a ${ OPTIMIZELY_SDK_VERSION} -m " Release ${ OPTIMIZELY_SDK_VERSION} " ;
148148 printf " \n\n9. Pushing git tag.\n"
149- git push origin $OPTIMIZELY_SDK_VERSION --verbose;
149+ git push origin ${ OPTIMIZELY_SDK_VERSION} --verbose;
150150fi ;
151151
152+ if git tag -l | grep -q " ${OPTIMIZELY_SDK_VERSION} "
153+ then
154+ printf " Release is tagged ${OPTIMIZELY_SDK_VERSION} \n" ;
155+ else
156+ printf " Release must be tagged ${OPTIMIZELY_SDK_VERSION} \n" ;
157+ printf " (If release isn't tagged, then 'pod trunk push ...' to COCOAPODS.ORG will fail.)"
158+ exit 1
159+ fi
160+
152161# ---- Make sure you have a Cocoapod session running ----
153162printf " \n\n10. Verify Cocoapod trunk session.\n" ;
154163pod trunk me;
@@ -169,6 +178,6 @@ for (( i = 0; i < ${number_pods}; i++ ));
169178do
170179 podname=${pods[i]} ;
171180 printf " Pushing the ${podname} pod to COCOAPODS.ORG .\n"
172- pod trunk push ${podname} .podspec
173- pod update ${podname}
181+ pod trunk push --allow-warnings ${podname} .podspec
182+ pod update
174183done
0 commit comments