mirror of
https://github.com/mas-cli/mas
synced 2024-11-26 21:40:19 +00:00
d583e74951
Also call install script instead of separate xcodebuild install command Fixes #179
41 lines
1.4 KiB
Bash
Executable file
41 lines
1.4 KiB
Bash
Executable file
#!/bin/bash -ex
|
|
|
|
BUILD_DIR="$PWD/build"
|
|
INTERNAL_PACKAGE="$BUILD_DIR/mas_temp.pkg"
|
|
OUTPUT_PACKAGE="$BUILD_DIR/mas.pkg"
|
|
|
|
IDENTIFIER="com.mphys.mas-cli"
|
|
COMPONENTS_PLIST="Homebrew/Components.plist"
|
|
DISTRIBUTION_PLIST="Homebrew/Distribution.plist"
|
|
|
|
# Destination for `xcodebuild install`
|
|
# DSTROOT will be updated if unset.
|
|
INSTALL_TEMPORARY_FOLDER=${DSTROOT:-build/distributions}
|
|
|
|
VERSION=$(agvtool what-marketing-version -terse1)
|
|
|
|
# Run Xcode's install process
|
|
script/install
|
|
|
|
echo "==> 📦 Assemble an installer package"
|
|
|
|
# Assemble pkg. 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 \
|
|
--component-plist "$COMPONENTS_PLIST" \
|
|
--identifier "$IDENTIFIER" \
|
|
--install-location "/usr/local" \
|
|
--root "$INSTALL_TEMPORARY_FOLDER" \
|
|
--version "$VERSION" \
|
|
"$INTERNAL_PACKAGE"
|
|
|
|
# Build 2nd pkg from 1st. Not sure why, but this is how Carthage does it.
|
|
# https://github.com/Carthage/Carthage/blob/master/Makefile#L87
|
|
productbuild \
|
|
--distribution "$DISTRIBUTION_PLIST" \
|
|
--package-path "$INTERNAL_PACKAGE" \
|
|
"$OUTPUT_PACKAGE"
|
|
|
|
echo "==> 🔢 Files Hashes"
|
|
shasum -a 256 mas.pkg
|