sfizz/scripts/appveyor/after_build.sh

68 lines
2.5 KiB
Bash
Raw Normal View History

2020-10-27 04:12:54 +01:00
#!/bin/bash
set -ex
make DESTDIR=${PWD}/${INSTALL_DIR} install
2020-11-14 16:56:21 +01:00
# Set bundle icons
# Note: disabled, rejected by the code-sign step
if false; then
bundle_icns=/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns
for bundle in sfizz.vst3 sfizz.component sfizz.lv2; do
fileicon set "${INSTALL_DIR}"/"$bundle" "$bundle_icns"
done
fi
2020-11-14 16:56:21 +01:00
# Perform code-signing
if test -z "${CODESIGN_PASSWORD}"; then
echo "! Secrets not available, skip code-signing"
else
# unlock the keychain
security unlock-keychain -p dummypasswd build.keychain
# code-sign VST3 and dylibs
2020-11-14 17:41:11 +01:00
codesign --sign "${CODESIGN_IDENTITY}" --deep --keychain build.keychain --force --verbose \
"${INSTALL_DIR}"/sfizz.vst3
2020-11-14 16:56:21 +01:00
# code-sign AudioUnit and dylibs
2020-11-14 17:41:11 +01:00
codesign --sign "${CODESIGN_IDENTITY}" --deep --keychain build.keychain --force --verbose \
"${INSTALL_DIR}"/sfizz.component
2020-11-14 16:56:21 +01:00
# code-sign LV2 and dylibs (note: manual, LV2 are not real bundles)
2020-11-14 17:41:11 +01:00
codesign --sign "${CODESIGN_IDENTITY}" --keychain build.keychain --force --verbose \
"${INSTALL_DIR}"/sfizz.lv2/Contents/Binary/*.so
if ls "${INSTALL_DIR}"/sfizz.lv2/Contents/Frameworks/*.dylib &> /dev/null; then
2020-11-14 17:41:11 +01:00
codesign --sign "${CODESIGN_IDENTITY}" --keychain build.keychain --force --verbose \
"${INSTALL_DIR}"/sfizz.lv2/Contents/Frameworks/*.dylib
2020-11-14 16:56:21 +01:00
fi
fi
2020-12-13 12:08:09 +01:00
# Create the DMG
cat > sfizz-dmg.json << EOF
{
"title": "sfizz",
"background": "${APPVEYOR_BUILD_FOLDER}/mac/dmg-back.png",
"window": {
"size": { "width": 500, "height": 500 }
},
"contents": [
{ "x": 100, "y": 50, "type": "file", "path": "${INSTALL_DIR}/sfizz.vst3" },
{ "x": 250, "y": 50, "type": "file", "path": "${INSTALL_DIR}/sfizz.component" },
{ "x": 400, "y": 50, "type": "file", "path": "${INSTALL_DIR}/sfizz.lv2" },
{ "x": 100, "y": 400, "type": "link", "path": "/Library/Audio/Plug-Ins/VST3" },
{ "x": 250, "y": 400, "type": "link", "path": "/Library/Audio/Plug-Ins/Components" },
{ "x": 400, "y": 400, "type": "link", "path": "/Library/Audio/Plug-Ins/LV2" }
]
}
EOF
~/node_modules/appdmg/bin/appdmg.js sfizz-dmg.json "${INSTALL_DIR}.dmg"
# Code-sign the DMG
if test ! -z "${CODESIGN_PASSWORD}"; then
security unlock-keychain -p dummypasswd build.keychain
codesign --sign "${CODESIGN_IDENTITY}" --keychain build.keychain --force --verbose "${INSTALL_DIR}.dmg"
fi
2020-10-27 04:12:54 +01:00
# Only release a tarball if there is a tag
if [[ ${APPVEYOR_REPO_TAG} ]]; then
mv "${INSTALL_DIR}.dmg" ${APPVEYOR_BUILD_FOLDER}
2020-10-27 04:12:54 +01:00
fi
cd ${APPVEYOR_BUILD_FOLDER}