Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Build/bundle/build_macos_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ STRICT_REVISION=0
UPLOAD=0
SIGN_IDENTITY="${CODESIGN_ID:-}"
NOTARY_PROFILE="${CFAST_MACOS_NOTARY_PROFILE:-}"
NOTARY_KEYCHAIN="${CFAST_MACOS_NOTARY_KEYCHAIN:-}"
SIGN_BUNDLE=0
NOTARIZE=0
if [[ "$SIGN_IDENTITY" != "" ]]; then
Expand Down Expand Up @@ -116,6 +117,7 @@ usage()
echo " --sign-identity identity Developer ID Application certificate used to sign CEditQt, CFAST, Smokeview, and the DMG"
echo " --notarize Submit the signed DMG with notarytool and staple the result (requires --notary-profile)"
echo " --notary-profile name Keychain profile for xcrun notarytool (or CFAST_MACOS_NOTARY_PROFILE)"
echo " --notary-keychain path Keychain containing the notary profile (or CFAST_MACOS_NOTARY_KEYCHAIN)"
echo " --no-dmg Stage files only"
echo " --no-layout Do not use a DMG background image"
echo " -h, --help Display this message"
Expand Down Expand Up @@ -1033,6 +1035,8 @@ sign_staged_macos_bundle()

notarize_macos_dmg()
{
local -a notary_credentials

if [[ "$NOTARIZE" != "1" ]]; then
return 0
fi
Expand All @@ -1046,8 +1050,14 @@ notarize_macos_dmg()
fi
require_command xcrun

notary_credentials=(--keychain-profile "$NOTARY_PROFILE")
if [[ "$NOTARY_KEYCHAIN" != "" ]]; then
require_file "$NOTARY_KEYCHAIN" "notarization keychain"
notary_credentials+=(--keychain "$NOTARY_KEYCHAIN")
fi

echo "*** Submitting DMG for Apple notarization"
xcrun notarytool submit "$DMG_PATH" --keychain-profile "$NOTARY_PROFILE" --wait
xcrun notarytool submit "$DMG_PATH" "${notary_credentials[@]}" --wait
echo "*** Stapling notarization ticket to DMG"
xcrun stapler staple "$DMG_PATH"
xcrun stapler validate "$DMG_PATH"
Expand Down Expand Up @@ -1644,6 +1654,10 @@ while [[ $# -gt 0 ]]; do
NOTARY_PROFILE="$2"
shift 2
;;
--notary-keychain)
NOTARY_KEYCHAIN="$2"
shift 2
;;
--no-dmg)
CREATE_DMG=0
shift
Expand Down
8 changes: 7 additions & 1 deletion Build/bundle/run_macos_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "$SCRIPT_DIR"
./build_macos_bundle.sh --manuals-from-release --upload --notarize --notary-profile CFAST_NOTARY "$@"
./build_macos_bundle.sh \
--manuals-from-release \
--upload \
--notarize \
--notary-profile CFAST_NOTARY \
--notary-keychain "$HOME/Library/Keychains/login.keychain-db" \
"$@"