Skip to content

Commit ee1b8c2

Browse files
Improved release.sh
1 parent d616bff commit ee1b8c2

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

Scripts/release.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fi;
5353
## ---- Extract OPTIMIZELY_SDK_VERSION from Xcode Build Settings. ----
5454
printf "\n\n3. Extracting OPTIMIZELY_SDK_VERSION from Xcode Build Settings.\n\n";
5555
OPTIMIZELY_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!
5959
printf "\n"
@@ -143,12 +143,21 @@ printf "the correct 'Target' branch. We expect you are tagging a commit\n"
143143
printf "on a #.#.x branch.)\n"
144144
read -n 1 -p "[y/n] $cr? " tag_release;
145145
if [ "$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;
150150
fi;
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 ----
153162
printf "\n\n10. Verify Cocoapod trunk session.\n";
154163
pod trunk me;
@@ -169,6 +178,6 @@ for (( i = 0; i < ${number_pods}; i++ ));
169178
do
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
174183
done

0 commit comments

Comments
 (0)