-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·36 lines (27 loc) · 1.4 KB
/
publish.sh
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
#!/bin/bash
currentDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "==> Publishing"
fullGitCommitMessage=`git log -1 --pretty=%B .`;
gitCommitMessage=`echo ${fullGitCommitMessage%%(publish*}`;
# read the current version number from the app plist;
CFBundleShortVersionString=`defaults read "$currentDir/Krep.app/Contents/Info.plist" CFBundleShortVersionString`;
currentVersion=`echo $CFBundleShortVersionString | bc`;
echo "==> Current version is : $currentVersion"
newBundleVersion=`echo $CFBundleShortVersionString + 0.01 | bc`;
echo "==> New verison will be : $newBundleVersion"
echo "==> Doing commit..."
# write the new version numbers to the plists;
defaults write "$currentDir/Krep.app/Contents/Info.plist" CFBundleShortVersionString $newBundleVersion;
defaults write "$currentDir/Krep.app/Contents/Info.plist" CFBundleVersion $newBundleVersion;
#check the versions
# CFBundleShortVersionString=`defaults read "$currentDir/Krep.app/Contents/Info.plist" CFBundleShortVersionString`;
# CFBundleVersion=`defaults read "$currentDir/Krep.app/Contents/Info.plist" CFBundleVersion`;
# echo "CFBundleShortVersionString is $CFBundleShortVersionString"
# echo "CFBundleVersion is $CFBundleVersion"
# do the git commit;
git add -A;
git commit -m "$gitCommitMessage (publish v$newBundleVersion)";
git tag -a $newBundleVersion -m "new version $newBundleVersion";
git push --tags;
git push --all;
echo "==> Done"