forked from Toxblh/MTMR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·63 lines (52 loc) · 1.91 KB
/
build.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
rm -r Release 2>/dev/null
xcodebuild archive \
-scheme "MTMR" \
-archivePath Release/App.xcarchive
xcodebuild \
-exportArchive \
-archivePath Release/App.xcarchive \
-exportOptionsPlist export-options.plist \
-exportPath Release
cd Release
rm -r App.xcarchive
rm -r MTMR.dmg
zip -r "MTMR.zip" "MTMR.app"
killall MTMR
rm -r "/Applications/MTMR.app"
cp -R "MTMR.app" "/Applications"
open "/Applications/MTMR.app"
hdiutil create -fs HFS+ -srcfolder ./MTMR.app -volname MTMR ./MTMR.dmg
DATE=`date +"%a, %d %b %Y %H:%M:%S %z"`
BUILD=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" MTMR.app/Contents/Info.plist`
VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" MTMR.app/Contents/Info.plist`
MINIMUM=`/usr/libexec/PlistBuddy -c "Print LSMinimumSystemVersion" MTMR.app/Contents/Info.plist`
SIZE=`stat -f%z MTMR.dmg`
SIGN=`~/Sparkle/bin/sign_update MTMR.dmg | awk '{printf "%s",$0} END {print ""}'`
SHA256=`shasum -a 256 MTMR.dmg | awk '{print $1}'`
# ditto -c -k --sequesterRsrc --keepParent "${NAME}.app" "${NAME}v${VERSION}.zip"
echo DATE $DATE
echo VERSION $VERSION
echo BUILD $BUILD
echo MINIMUM $MINIMUM
echo SIZE $SIZE
echo SIGN ${SIGN}
echo "<?xml version=\"1.0\" standalone=\"yes\"?>
<rss xmlns:sparkle=\"http://www.andymatuschak.org/xml-namespaces/sparkle\" version=\"2.0\">
<channel>
<item>
<title>${VERSION}</title>
<pubDate>${DATE}</pubDate>
<description>
${1}
</description>
<sparkle:minimumSystemVersion>${MINIMUM}</sparkle:minimumSystemVersion>
<enclosure url=\"https://github.com/ad/MTMR/releases/download/latest/MTMR.dmg\"
sparkle:version=\"${BUILD}\"
sparkle:shortVersionString=\"${VERSION}\"
length=\"${SIZE}\"
type=\"application/octet-stream\"
${SIGN}
/>
</item>
</channel>
</rss>" > appcast.xml