From 486118d6a4d571da2cfec02b83725b195b9e4f2f Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 4 Mar 2024 14:15:43 +0100 Subject: [PATCH] rewrite --- apps/remixdesktop/notarizedmg.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/remixdesktop/notarizedmg.sh b/apps/remixdesktop/notarizedmg.sh index f8ae1de596..436e7ca0bd 100644 --- a/apps/remixdesktop/notarizedmg.sh +++ b/apps/remixdesktop/notarizedmg.sh @@ -6,28 +6,34 @@ JSON_FILE="dmgs.json" # Read the DMGs array from the JSON file DMG_PATHS=$(jq -r '.dmgs[]' "$JSON_FILE") +echo $DMG_PATHS + xcrun notarytool store-credentials "notarytool-password" \ --apple-id ${APPLE_ID} \ --team-id ${APPLE_TEAM_ID} \ --password ${APPLE_ID_PASSWORD} -# Loop over the DMG paths -for DMG_PATH in $DMG_PATHS; do +# Use jq to parse the DMGs array and read each line +while IFS= read -r DMG_PATH; do # Remove single quotes from the path if present DMG_PATH_CLEANED=$(echo $DMG_PATH | tr -d "'") echo "Submitting $DMG_PATH_CLEANED for notarization..." - # Run your notarytool submit command here - # Ensure you replace `your-app-specific-args` with actual arguments for your app - xcrun notarytool submit "$DMG_PATH_CLEANED" --keychain-profile "notarytool-password" --wait + # Replace `your-app-specific-args` with the actual arguments for your app + # Ensure your notarytool command and arguments are correct for your application + notarytool submit "$DMG_PATH_CLEANED" --keychain-profile "notarytool-password" --wait - # Check for success/failure if necessary + # Check the command's success if [ $? -eq 0 ]; then echo "Successfully submitted $DMG_PATH_CLEANED for notarization." + xcrun stapler staple "$DMG_PATH_CLEANED" + echo "Successfully stapled $DMG_PATH_CLEANED." + spctl -a -t open -vvv --context context:primary-signature "$DMG_PATH_CLEANED" + echo "Successfully checked $DMG_PATH_CLEANED." else echo "Failed to submit $DMG_PATH_CLEANED for notarization." fi -done +done < <(jq -r '.dmgs[]' "$JSON_FILE") echo "All DMG submissions completed."