Skip to content

Commit

Permalink
馃彈Build: Build scripts updated [notarization]
Browse files Browse the repository at this point in the history
  • Loading branch information
vookimedlo committed Jan 13, 2020
1 parent 621e743 commit 640ec0e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 48 deletions.
1 change: 1 addition & 0 deletions src/scripts/create-package-noUpdater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PLIST_FILE)
ZIP_NAME="CK550_MacOS_Effect_Controller-$VERSION-NoUpdater.zip"
ZIP_PATH="$RELEASE_OUTPUT_DIR/$ZIP_NAME"

rm -f "$ZIP_PATH" || true
ditto -c -k --sequesterRsrc --keepParent ../build-noupdate/Build/Products/Release/ck550.app $ZIP_PATH
echo "$ZIP_NAME was created."
SHASUM=$(shasum -ba 256 $ZIP_PATH)
Expand Down
52 changes: 52 additions & 0 deletions src/scripts/create-package-sparkle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh
cd $(dirname "$0")

RELEASE_OUTPUT_DIR="./release-output"
PLIST_FILE="../build/Build/Products/Release/ck550.app/Contents/Info.plist"
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PLIST_FILE)
SHORT_VERSION_STRING=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" $PLIST_FILE)
MIN_MACOS=$(/usr/libexec/PlistBuddy -c "Print LSMinimumSystemVersion" $PLIST_FILE)

ZIP_NAME="CK550_MacOS_Effect_Controller-$VERSION.zip"
ZIP_PATH="$RELEASE_OUTPUT_DIR/$ZIP_NAME"
XML_PATH="$RELEASE_OUTPUT_DIR/AppCast.xml"

DATE=$(TZ=GMT date)

rm -f "$ZIP_PATH" || true
ditto -c -k --sequesterRsrc --keepParent ../build/Build/Products/Release/ck550.app $ZIP_PATH

echo "$ZIP_NAME was created."
shasum -ba 256 $ZIP_PATH

SIGNATURE_AND_SIZE=$(~/Development/_scm/_foreign/Sparkle/bin/sign_update $ZIP_PATH)

echo "$ZIP_NAME signature was created."

cat > "$XML_PATH" <<EOF
<?xml version="1.0" encoding="utf-8"?>
<rss
version="2.0"
xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"
xmlns:dc="http://purl.org/dc/elements/1.1/" >
<channel>
<title>CK550-MacOS GUI</title>
<description>MacOS effect control SW for a CoolMaster CK550 Keyboard (US Layout).</description>
<language>en</language>
<item>
<title>Version $SHORT_VERSION_STRING</title>
<sparkle:minimumSystemVersion>$MIN_MACOS</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>https://f001.backblazeb2.com/file/Sparkle-Data/ck550/changelog.html</sparkle:releaseNotesLink>
<pubDate>$DATE +0000</pubDate>
<enclosure
url="https://github.com/vookimedlo/ck550-macos/releases/download/$TAG/$ZIP_NAME"
sparkle:version="$VERSION"
sparkle:shortVersionString="$SHORT_VERSION_STRING"
$SIGNATURE_AND_SIZE
type="application/octet-stream" />
</item>
</channel>
</rss>
EOF

echo "AppCast.xml was created."
48 changes: 0 additions & 48 deletions src/scripts/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,54 +54,6 @@ xcodebuild -workspace ck550.xcworkspace -scheme ck550 -clonedSourcePackagesDirPa
cd scripts

echo "App was built."

PLIST_FILE="../build/Build/Products/Release/ck550.app/Contents/Info.plist"
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PLIST_FILE)
SHORT_VERSION_STRING=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" $PLIST_FILE)
MIN_MACOS=$(/usr/libexec/PlistBuddy -c "Print LSMinimumSystemVersion" $PLIST_FILE)

ZIP_NAME="CK550_MacOS_Effect_Controller-$VERSION.zip"
ZIP_PATH="$RELEASE_OUTPUT_DIR/$ZIP_NAME"
XML_PATH="$RELEASE_OUTPUT_DIR/AppCast.xml"

DATE=$(TZ=GMT date)

ditto -c -k --sequesterRsrc --keepParent ../build/Build/Products/Release/ck550.app $ZIP_PATH

echo "$ZIP_NAME was created."
shasum -ba 256 $ZIP_PATH

SIGNATURE_AND_SIZE=$(~/Development/_scm/_foreign/Sparkle/bin/sign_update $ZIP_PATH)

echo "$ZIP_NAME signature was created."

cat > "$XML_PATH" <<EOF
<?xml version="1.0" encoding="utf-8"?>
<rss
version="2.0"
xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"
xmlns:dc="http://purl.org/dc/elements/1.1/" >
<channel>
<title>CK550-MacOS GUI</title>
<description>MacOS effect control SW for a CoolMaster CK550 Keyboard (US Layout).</description>
<language>en</language>
<item>
<title>Version $SHORT_VERSION_STRING</title>
<sparkle:minimumSystemVersion>$MIN_MACOS</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>https://f001.backblazeb2.com/file/Sparkle-Data/ck550/changelog.html</sparkle:releaseNotesLink>
<pubDate>$DATE +0000</pubDate>
<enclosure
url="https://github.com/vookimedlo/ck550-macos/releases/download/$TAG/$ZIP_NAME"
sparkle:version="$VERSION"
sparkle:shortVersionString="$SHORT_VERSION_STRING"
$SIGNATURE_AND_SIZE
type="application/octet-stream" />
</item>
</channel>
</rss>
EOF

echo "AppCast.xml was created."
echo "Release was created successfuly."

exit 0

0 comments on commit 640ec0e

Please sign in to comment.