mas/script/package

47 lines
1.1 KiB
Text
Raw Normal View History

2018-10-16 04:17:07 +00:00
#!/bin/bash -ex
xcodebuild install
2015-09-20 10:23:36 +00:00
pushd build
2016-02-21 12:50:56 +00:00
echo "==> 🗜️ Compressing mas.xcarchive"
2015-09-20 10:23:36 +00:00
zip -r mas.xcarchive.zip mas.xcarchive
echo "==> ️🗜️ Compressing binary and framework"
2018-10-16 04:17:07 +00:00
pushd mas.xcarchive/Products
zip -r \
mas-cli.zip \
usr/local/bin/mas \
Library/Frameworks/MasKit.framework
mv mas-cli.zip ../../
popd
2018-10-16 04:17:07 +00:00
echo "==> 📦 Assemble an installer package"
IDENTIFIER=com.mphys.mas-cli
COMPONENTS_PLIST=../Homebrew/Components.plist
DISTRIBUTION_PLIST=../Homebrew/Distribution.plist
INSTALL_TEMPORARY_FOLDER=/tmp/mas-cli.dst
INTERNAL_PACKAGE=mas_temp.pkg
OUTPUT_PACKAGE=mas.pkg
VERSION_STRING=1.1.1
tree "$INSTALL_TEMPORARY_FOLDER"
pkgbuild \
--component-plist "$COMPONENTS_PLIST" \
--identifier "$IDENTIFIER" \
--install-location "/" \
--root "$INSTALL_TEMPORARY_FOLDER" \
--version "$VERSION_STRING" \
"$INTERNAL_PACKAGE"
productbuild \
--distribution "$DISTRIBUTION_PLIST" \
--package-path "$INTERNAL_PACKAGE" \
"$OUTPUT_PACKAGE"
echo -n "==> 🔢 SHA256 "
shasum -a 256 mas-cli.zip mas.xcarchive.zip mas.pkg
popd