signmacosdesktop
filip mertens 11 months ago
parent c71f9fb4da
commit a4b7ec2b5a
  1. 20
      apps/remixdesktop/notarizedmg.sh

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

Loading…
Cancel
Save