Skip to content

Commit 1aaf495

Browse files
committed
fix: Handle Developer ID certificate types for PKG signing
PKG signing with productsign requires "Developer ID Installer" certificate, not "Developer ID Application" certificate. Updated scripts to: - Check certificate type before attempting productsign - Only sign PKG if proper Installer certificate is available - Log clear warnings when using unsigned PKG - App bundle inside PKG remains signed with Application certificate This resolves the CI error: "productsign: error: Could not find appropriate signing identity for 'Developer ID Application'"
1 parent b911e5e commit 1aaf495

2 files changed

Lines changed: 36 additions & 15 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,9 @@ jobs:
520520
echo "✅ Found Developer ID Installer certificate: ${PKG_CERT_IDENTITY}"
521521
else
522522
echo "⚠️ No specific Developer ID Installer certificate found"
523-
echo "Using Developer ID Application certificate for PKG signing (this is valid)"
524-
PKG_CERT_IDENTITY="${APP_CERT_IDENTITY}"
523+
echo "Note: PKG signing requires a separate 'Developer ID Installer' certificate"
524+
echo "App bundle will be signed with Developer ID Application, PKG will be unsigned"
525+
PKG_CERT_IDENTITY="" # Don't pass app cert to PKG signing
525526
fi
526527
527528
# Export certificate identities for scripts to use
@@ -533,7 +534,12 @@ jobs:
533534
CORE_BINARY="mcpproxy"
534535
535536
# Create PKG installer with both tray and core binaries
536-
echo "Creating PKG installer with certificate: ${PKG_CERT_IDENTITY}"
537+
if [ -n "${PKG_CERT_IDENTITY}" ]; then
538+
echo "Creating signed PKG installer with certificate: ${PKG_CERT_IDENTITY}"
539+
else
540+
echo "Creating PKG installer (unsigned - app bundle inside will be signed)"
541+
echo "Note: PKG signing requires a separate Developer ID Installer certificate"
542+
fi
537543
./scripts/create-pkg.sh ${TRAY_BINARY} ${CORE_BINARY} ${VERSION} ${{ matrix.goarch }}
538544
539545
# Create installer DMG containing the PKG

scripts/create-pkg.sh

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,25 +325,40 @@ else
325325
fi
326326
fi
327327

328+
# Check if the certificate is actually a "Developer ID Installer" certificate
328329
if [ -n "${INSTALLER_CERT_IDENTITY}" ]; then
330+
if echo "${INSTALLER_CERT_IDENTITY}" | grep -q "Developer ID Installer"; then
331+
echo "✅ Valid Developer ID Installer certificate found"
329332

330-
# Sign the PKG
331-
productsign --sign "${INSTALLER_CERT_IDENTITY}" \
332-
--timestamp \
333-
"${PKG_NAME}.pkg" \
334-
"${PKG_NAME}-signed.pkg"
333+
# Sign the PKG with proper installer certificate
334+
if productsign --sign "${INSTALLER_CERT_IDENTITY}" \
335+
--timestamp \
336+
"${PKG_NAME}.pkg" \
337+
"${PKG_NAME}-signed.pkg"; then
335338

336-
# Replace unsigned with signed
337-
mv "${PKG_NAME}-signed.pkg" "${PKG_NAME}.pkg"
339+
# Replace unsigned with signed
340+
mv "${PKG_NAME}-signed.pkg" "${PKG_NAME}.pkg"
338341

339-
# Verify PKG signing
340-
echo "=== Verifying PKG signature ==="
341-
pkgutil --check-signature "${PKG_NAME}.pkg"
342+
# Verify PKG signing
343+
echo "=== Verifying PKG signature ==="
344+
pkgutil --check-signature "${PKG_NAME}.pkg"
342345

343-
echo "✅ PKG signed successfully"
346+
echo "✅ PKG signed successfully with Developer ID Installer certificate"
347+
else
348+
echo "❌ PKG signing with productsign failed"
349+
echo "Keeping unsigned PKG"
350+
fi
351+
else
352+
echo "⚠️ Certificate is not a Developer ID Installer certificate: ${INSTALLER_CERT_IDENTITY}"
353+
echo "productsign requires specifically a 'Developer ID Installer' certificate"
354+
echo "Creating unsigned PKG (component PKG is still signed with app certificate)"
355+
echo ""
356+
echo "Note: The app bundle inside the PKG is properly signed with Developer ID Application certificate"
357+
echo "The PKG container itself will be unsigned, but may still work for testing"
358+
fi
344359
else
345360
echo "❌ No Developer ID Installer certificate found"
346-
echo "PKG will be unsigned (will not pass notarization)"
361+
echo "Creating unsigned PKG (component PKG is still signed with app certificate)"
347362
fi
348363

349364
# Clean up

0 commit comments

Comments
 (0)