forked from adlr/formulatepro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·42 lines (37 loc) · 1.06 KB
/
release.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
#!/bin/bash
# simple usage: $ ./release.sh -v 0.0.6
# $1 - source folder
# $2 - volume name
# $3 - output file
# for example:
# ./release.sh ./build/Release/FormulatePro.app FormulatePro-0.0.2 FormulatePro-0.0.2.dmg
if [ "$1" = "-v" ]; then
SRC="./build/Release/FormulatePro.app"
VOL="FormulatePro-$2"
OUT="$VOL.dmg"
VERS=$2
else
SRC="$1"
VOL="$2"
OUT="$3"
fi
echo "SRC = '$SRC'"
echo "VOL = '$VOL'"
echo "OUT = '$OUT'"
echo Creating .dmg file
GZIP=-9 hdiutil create -fs HFS+ -srcfolder "$SRC" -volname "$VOL" "$OUT"
echo signing
SIG=$(ruby ./third_party/Sparkle/Extras/Signing\ Tools/sign_update.rb \
"$OUT" ./dsa_priv.pem)
cat <<EOF
<item>
<title>Version $VERS</title>
<description>http://adlr.info/appcasts/$VOL.html</description>
<pubDate>$(date)</pubDate>
<enclosure sparkle:version="$VERS"
url="http://adlr.info/appcasts/$VOL.dmg"
sparkle:dsaSignature="$SIG"
length="$(stat -f "%z" "$OUT")"
type="application/octet-stream"/>
</item>
EOF