forked from codykrieger/gfxCardStatus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sparkle_deploy.sh
executable file
·35 lines (28 loc) · 1.13 KB
/
sparkle_deploy.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
./build_release.sh
BUILT_PRODUCTS_DIR="$(pwd)/build/Release"
PROJECT_NAME="gfxCardStatus"
VERSION=$(defaults read "$BUILT_PRODUCTS_DIR/$PROJECT_NAME.app/Contents/Info.plist" CFBundleVersion)
DOWNLOAD_BASE_URL="http://codykrieger.com/downloads"
RELEASENOTES_URL="http://codykrieger.com/gfxCardStatus/releasenotes/$VERSION.html"
ARCHIVE_FILENAME="$PROJECT_NAME-$VERSION.zip"
DOWNLOAD_URL="$DOWNLOAD_BASE_URL/$ARCHIVE_FILENAME"
KEYCHAIN_PRIVKEY_NAME="Sparkle Private Key"
WD=$PWD
cd "$BUILT_PRODUCTS_DIR"
rm -f "$PROJECT_NAME"*.zip
ditto -ck --keepParent "$PROJECT_NAME.app" "$ARCHIVE_FILENAME"
SIZE=$(stat -f %z "$ARCHIVE_FILENAME")
PUBDATE=$(LC_TIME=en_US date +"%a, %d %b %G %T %z")
SIGNATURE=$("$WD"/sign_update.rb "$ARCHIVE_FILENAME" "$WD"/dsa_priv.pem)
[ $SIGNATURE ] || { echo Unable to load private key; false; }
cat <<EOF
<item>
<title>Version $VERSION</title>
<sparkle:releaseNotesLink>
$RELEASENOTES_URL
</sparkle:releaseNotesLink>
<pubDate>$PUBDATE</pubDate>
<enclosure url="$DOWNLOAD_URL" sparkle:version="$VERSION" type="application/octet-stream" length="$SIZE" sparkle:dsaSignature="$SIGNATURE" />
</item>
EOF