🗜 Update mas.pkg build

This commit is contained in:
Chris Araman 2021-04-28 22:28:29 -07:00
parent d0738e50b6
commit a3e32656bc
No known key found for this signature in database
GPG key ID: BB4499D9E11B61E0
5 changed files with 9 additions and 43 deletions

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>BundleIsVersionChecked</key>
<true/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>ChildBundles</key>
<array>
<dict>
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
<string>Frameworks/MasKit.framework/Versions/A/Frameworks/Commandant.framework</string>
</dict>
</array>
<key>RootRelativeBundlePath</key>
<string>Frameworks/MasKit.framework</string>
</dict>
</array>
</plist>

View file

@ -13,5 +13,4 @@ echo "Building mas $VERSION artifacts"
script/clean script/clean
script/build script/build
script/archive script/archive
script/install
script/package script/package

View file

@ -21,8 +21,6 @@ else
PREFIX=/usr/local PREFIX=/usr/local
fi fi
script/build
echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX" echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX"
ditto -v \ ditto -v \
".build/apple/Products/Release/mas" \ ".build/apple/Products/Release/mas" \

View file

@ -6,46 +6,38 @@
# Builds macOS installer component and distribution packages. # Builds macOS installer component and distribution packages.
# #
BUILD_DIR="$PWD/build" BUILD_DIR="$PWD/.build"
COMPONENT_PACKAGE="$BUILD_DIR/mas_components.pkg" COMPONENT_PACKAGE="$BUILD_DIR/mas_components.pkg"
DISTRIBUTION_PACKAGE="$BUILD_DIR/mas.pkg" DISTRIBUTION_PACKAGE="$BUILD_DIR/mas.pkg"
IDENTIFIER="com.mphys.mas-cli" IDENTIFIER="com.mphys.mas-cli"
# Component package definition
COMPONENTS_PLIST="Package/Components.plist"
# Distribution package definition # Distribution package definition
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html # https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html
DISTRIBUTION_PLIST="Package/Distribution.plist" DISTRIBUTION_PLIST="Package/Distribution.plist"
# Destination for `xcodebuild install` # Destination for install root
# DSTROOT will be updated if unset. DSTROOT=.build/distributions
INSTALL_TEMPORARY_FOLDER=${DSTROOT:-build/distributions} script/install "$DSTROOT/usr/local"
mkdir -p "$INSTALL_TEMPORARY_FOLDER"
VERSION=$(script/version) VERSION=$(script/version)
echo "==> 📦 Assemble an installer package" echo "==> 📦 Assemble an installer package"
# Assemble macOS installer component package (aka "product archive"). # Assemble macOS installer component package (aka "product archive").
# Using /usr/local prefix to avoid the following errors with "/"
# - installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
# - GUI warning: This package is incompatible with this version of macOS and may fail to install. (may damage your system... )
pkgbuild \ pkgbuild \
--identifier "$IDENTIFIER" \ --identifier "$IDENTIFIER" \
--install-location "/usr/local" \ --install-location "/" \
--version "$VERSION" \ --version "$VERSION" \
--root "$INSTALL_TEMPORARY_FOLDER" \ --root "$DSTROOT" \
--component-plist "$COMPONENTS_PLIST" \
"$COMPONENT_PACKAGE" "$COMPONENT_PACKAGE"
# Build distribution package (aka "product archive"). Not sure why, but this is how Carthage does it. # Build distribution package (aka "product archive"). Not sure why, but this is how Carthage does it.
# https://github.com/Carthage/Carthage/blob/master/Makefile#L87 # https://github.com/Carthage/Carthage/blob/master/Makefile#L69
productbuild \ productbuild \
--distribution "$DISTRIBUTION_PLIST" \ --distribution "$DISTRIBUTION_PLIST" \
--package-path "$BUILD_DIR" \ --package-path "$BUILD_DIR" \
"$DISTRIBUTION_PACKAGE" "$DISTRIBUTION_PACKAGE"
echo "==> 🔢 Files Hashes" echo "==> 🔢 File Hash"
shasum -a 256 "$DISTRIBUTION_PACKAGE" shasum -a 256 "$DISTRIBUTION_PACKAGE"

View file

@ -11,7 +11,7 @@ IDENTIFIER=com.mphys.mas-cli
echo "==> 📲 Installing mas" echo "==> 📲 Installing mas"
sudo installer \ sudo installer \
-pkg build/mas.pkg \ -pkg .build/mas.pkg \
-target / -target /
pkgutil --pkg-info "$IDENTIFIER" pkgutil --pkg-info "$IDENTIFIER"