Bundler: add macOS code signing and .dmg + .zip packing.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
# or via environment variable:
|
||||
#
|
||||
# - STORAGE_DIRECTORY
|
||||
# - CODESIGN_IDENTITY (macOS only)
|
||||
#
|
||||
# This is directory where persistent "temporary" files will be stored.
|
||||
# For example, this is where benchmark repository is being checked out.
|
||||
@@ -97,8 +98,8 @@ if [ "${KERNEL_NAME}" == "Linux" ]; then
|
||||
BLENDER_PLATFORM_AND_EXTENSION="${BLENDER_PLATFORM}.tar.bz2"
|
||||
fi
|
||||
elif [ "${KERNEL_NAME}" == "Darwin" ]; then
|
||||
BLENDER_PLATFORM="macOS-10.6"
|
||||
BLENDER_PLATFORM_AND_EXTENSION="${BLENDER_PLATFORM}.zip"
|
||||
BLENDER_PLATFORM="macOS-10.9"
|
||||
BLENDER_PLATFORM_AND_EXTENSION="macOS-10.6.zip"
|
||||
elif [[ "${KERNEL_NAME}" == "MINGW"* ]]; then
|
||||
if [ "${BITNESS}" == "64" ]; then
|
||||
BLENDER_PLATFORM="windows64"
|
||||
@@ -214,6 +215,13 @@ if [ -z "${BLENDER_VERSION}" ]; then
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "${KERNEL_NAME}" == "Darwin" ]; then
|
||||
if [ -z "${CODESIGN_IDENTITY}" ]; then
|
||||
echo "ERROR: CODESIGN_IDENTITY is not specified, can not continue."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
# Check out benchmark repository.
|
||||
|
||||
@@ -226,7 +234,7 @@ else
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
# Compile blender-benchmark
|
||||
# Compile blender-benchmark.
|
||||
|
||||
# We always start from scratch.
|
||||
rm -rf "${BUNDLE_DIRECTORY}"
|
||||
@@ -363,12 +371,41 @@ for scene in ${SCENES}; do
|
||||
fi
|
||||
done
|
||||
|
||||
################################################################################
|
||||
# Code signing.
|
||||
|
||||
if [ "${KERNEL_NAME}" == "Darwin" ]; then
|
||||
codesign -s "${CODESIGN_IDENTITY}" "${BUNDLE_DIRECTORY}/blender-benchmark.app" || exit 1
|
||||
codesign -dv --verbose=4 "${BUNDLE_DIRECTORY}/blender-benchmark.app"
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
# Package.
|
||||
|
||||
echo "Packing bundle into archive..."
|
||||
${TAR} \
|
||||
-C "${STORAGE_DIRECTORY}" \
|
||||
--exclude='*.pyc' \
|
||||
-cjf `basename ${BUNDLE_DIRECTORY}`.tar.bz2 \
|
||||
"`basename ${BUNDLE_DIRECTORY}`"
|
||||
if [ "${KERNEL_NAME}" == "Darwin" ]; then
|
||||
DMG_FILE="${STORAGE_DIRECTORY}/`basename ${BUNDLE_DIRECTORY}`.dmg"
|
||||
ZIP_FILE="${STORAGE_DIRECTORY}/`basename ${BUNDLE_DIRECTORY}`.zip"
|
||||
|
||||
echo "Creating ${DMG_FILE}"
|
||||
hdiutil create \
|
||||
-volname "Blender Benchmark" \
|
||||
-srcfolder "${BUNDLE_DIRECTORY}" \
|
||||
-fs HFS+ \
|
||||
-ov -format UDZO \
|
||||
"${DMG_FILE}"
|
||||
codesign -s "${CODESIGN_IDENTITY}" "${DMG_FILE}"
|
||||
codesign -dv --verbose=4 "${DMG_FILE}"
|
||||
|
||||
echo "Creating ${ZIP_FILE}"
|
||||
zip -r ${ZIP_FILE} \
|
||||
"${BUNDLE_DIRECTORY}" \
|
||||
--exclude='*.DS_Store*' \
|
||||
--exclude='*.pyc*'
|
||||
else
|
||||
${TAR} \
|
||||
-C "${STORAGE_DIRECTORY}" \
|
||||
--exclude='*.pyc' \
|
||||
-cjf `basename ${BUNDLE_DIRECTORY}`.tar.bz2 \
|
||||
"`basename ${BUNDLE_DIRECTORY}`"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user