remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remixdesktop/notarizedmg.sh

40 lines
1.4 KiB

9 months ago
#!/bin/bash
# Path to the JSON file containing the DMG paths
JSON_FILE="dmgs.json"
# Read the DMGs array from the JSON file
DMG_PATHS=$(jq -r '.dmgs[]' "$JSON_FILE")
9 months ago
echo $DMG_PATHS
9 months ago
xcrun notarytool store-credentials "notarytool-password" \
--apple-id ${APPLE_ID} \
--team-id ${APPLE_TEAM_ID} \
--password ${APPLE_ID_PASSWORD}
9 months ago
# Use jq to parse the DMGs array and read each line
while IFS= read -r DMG_PATH; do
9 months ago
# Remove single quotes from the path if present
DMG_PATH_CLEANED=$(echo $DMG_PATH | tr -d "'")
echo "Submitting $DMG_PATH_CLEANED for notarization..."
9 months ago
# Replace `your-app-specific-args` with the actual arguments for your app
# Ensure your notarytool command and arguments are correct for your application
9 months ago
xcrun notarytool submit "$DMG_PATH_CLEANED" --keychain-profile "notarytool-password" --wait
9 months ago
9 months ago
# Check the command's success
9 months ago
if [ $? -eq 0 ]; then
echo "Successfully submitted $DMG_PATH_CLEANED for notarization."
9 months ago
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."
9 months ago
else
echo "Failed to submit $DMG_PATH_CLEANED for notarization."
fi
9 months ago
done < <(jq -r '.dmgs[]' "$JSON_FILE")
9 months ago
echo "All DMG submissions completed."