Add: Overlay cargo icon in vehicle/depot list when holding shift+ctrl. (#12938)
[openttd-github.git] / os / macosx / notarize.sh
blobc34606bdc2310f7386b4ff51b9d07b810b878bda
1 #!/bin/bash
2 set -e
4 # This script attempts to notarize the OpenTTD DMG generated by CPack.
5 # If you are building an unofficial branch of OpenTTD, please change the bundle
6 # ID in Info.plist and below.
8 # This uses the Xcode notarytool to perform notarization. You must set up a keychain
9 # profile called "openttd" using the "store-credentials" notarytool command beforehand.
11 # Before executing this script, you must first configure CMake with at least the following
12 # parameters:
14 # -DCPACK_BUNDLE_APPLE_CERT_APP={certificate ID}
15 # "-DCPACK_BUNDLE_APPLE_CODESIGN_PARAMETER=--deep -f --options runtime"
17 # then run "make package" or "cpack".
19 # This will sign the application with your signing certificate, and will enable
20 # the hardened runtime.
22 # Then, ensuring you're in your build directory and that the "bundles" directory
23 # exists with a .dmg in it (clear out any old DMGs first), run:
25 # ../os/macosx/notarize.sh
27 dmg_filename=(bundles/*.dmg)
29 if [ "${dmg_filename}" = "bundles/*.dmg" ]; then
30 echo "No .dmg found in the bundles directory, skipping notarization. Please read this"
31 echo "script's source for execution instructions."
32 exit 1
33 fi;
35 xcrun notarytool submit ${dmg_filename[0]} --keychain-profile "openttd" --wait
37 # Staple the ticket to the .dmg
38 xcrun stapler staple "${dmg_filename[0]}"
40 app_filename=(_CPack_Packages/*/Bundle/openttd-*/OpenTTD.app)
42 if [ "${app_filename}" = "_CPack_Packages/*/Bundle/openttd-*/OpenTTD.app" ]; then
43 echo "No .app found in the _CPack_Packages directory, skipping app stapling."
44 exit 0
45 fi;
47 # Now staple the ticket to the .app
48 xcrun stapler staple "${app_filename[0]}"