Created
August 6, 2026 19:30
-
-
Save Draknek/31f983c3f9b8ee084e8f6a4107b36b15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| this_dir="$( dirname "${BASH_SOURCE[0]}" )" | |
| if [ -f "$this_dir/config.sh" ] | |
| then | |
| . "$this_dir/config.sh" | |
| fi | |
| for i in RCODESIGN NOTARIZE_P12_PASSWORD | |
| do | |
| if [ -z "${!i}" ] | |
| then | |
| echo "Config not set up: no $i variable defined" | |
| exit 1 | |
| fi | |
| done | |
| p12_file="$this_dir/notarize.p12" | |
| json_file="$this_dir/notarize.json" | |
| # trim trailing slashes from target file | |
| TARGET=$(echo "$1" | sed 's:/*$::') | |
| if [ $# -ne 1 ] | |
| then | |
| echo "Usage: $0 path/to/game.app" | |
| exit | |
| fi | |
| if [ -f "$TARGET" ] | |
| then | |
| echo "$1 needs to be a .app folder" | |
| exit 1 | |
| fi | |
| if ! [ -d "$TARGET" ] | |
| then | |
| echo "$1 does not exist" | |
| exit 1 | |
| fi | |
| if [ "${TARGET: -4}" != ".app" ] | |
| then | |
| echo "$1 needs to be a .app folder" | |
| exit 1 | |
| fi | |
| "$RCODESIGN" sign --p12-file "$p12_file" --p12-password "$NOTARIZE_P12_PASSWORD" --for-notarization "$TARGET" && \ | |
| "$RCODESIGN" notary-submit --api-key-file "$json_file" --staple "$TARGET" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment