-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathdeploy
executable file
·49 lines (34 loc) · 1.61 KB
/
deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -euo pipefail
git fetch --tags -p
# Check if there are uncommitted changes
git diff-index --quiet HEAD -- || { echo "ERROR: You have uncommitted local changes. Commit or clean up before proceeding."; exit; }
git checkout fetch -p
git checkout master
git pull -r
LATEST_GIT_TAG=`git describe --tags --abbrev=0`
BUNDLE_VERSION=`xcrun agvtool what-version | grep -Eo "\d+\.\d+\.\d+"`
POD_VERSION=`grep "s.version[ ]\+=" TradeItIosTicketSDK2.podspec | grep -Eo "\d+\.\d+\.\d+"`
if [[ "$BUNDLE_VERSION" != "$POD_VERSION" || "$BUNDLE_VERSION" != "$LATEST_GIT_TAG" ]]; then
echo "Mismatch between bundle version ${BUNDLE_VERSION}, pod version ${POD_VERSION}, and ${LATEST_GIT_TAG}!!!. Rectify versions/tag before running the deploy script..."
exit 1
fi
echo "Current version: ${BUNDLE_VERSION}"
echo -n "Enter new version to deploy?:"
read NEW_VERSION
echo -e "\n\nPreparing to deploy new version ${NEW_VERSION}..."
sleep 3 # Pause to give user a chance to back out with Ctrl-C
echo -e "\n\nSetting new bundle version..."
xcrun agvtool new-version -all $NEW_VERSION
xcrun agvtool new-marketing-version $NEW_VERSION
echo -e "\n\nUpdating TradeItIosTicketSDK2.podspec version..."
sed -i "" "s/= '$POD_VERSION'/= '$NEW_VERSION'/g" TradeItIosTicketSDK2.podspec
git add TradeItIosTicketSDK2.podspec
git add TradeItIosTicketSDK2.xcodeproj/project.pbxproj
git add */Info.plist
git commit -m "Version: $NEW_VERSION" -e -v
carthage build --no-skip-current --platform iOS
git tag $NEW_VERSION
git push origin $NEW_VERSION
git push origin HEAD
pod repo push tradingticket TradeItIosTicketSDK2.podspec --verbose --allow-warnings