Skip to content

Commit bca179e

Browse files
committed
Fix flaky productsign gate: use INSTALLER env var presence
`security find-identity -v` was intermittently not seeing the imported Developer ID Installer cert on the GitHub Actions macos-latest runner, causing the .pkg to ship unsigned and Apple notary to reject it. Gate the codesign / productsign branches on the env-var presence (which is what the keychain bootstrap already gated on) instead. Also surface notary rejection details on failure via `xcrun notarytool log`.
1 parent dff363f commit bca179e

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Installer/build.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ if [ "$PLATFORM" = "macOS" ]; then
6666
cp -RL "$ART_DIR/CLAP/$PLUGIN.clap" "$STAGE/clap/"
6767

6868

69-
if security find-identity -v -p codesigning | grep -q "$DEV_APP_ID"; then
69+
if [ -n "${APPLICATION:-}" ]; then
7070
codesign -s "$DEV_APP_ID" --options=runtime --timestamp --force -v "$STAGE/vst/$PLUGIN.vst"
7171
codesign -s "$DEV_APP_ID" --options=runtime --timestamp --force -v "$STAGE/vst3/$PLUGIN.vst3"
7272
codesign -s "$DEV_APP_ID" --options=runtime --timestamp --force -v "$STAGE/au/$PLUGIN.component"
7373
codesign -s "$DEV_APP_ID" --options=runtime --timestamp --force -v "$STAGE/clap/$PLUGIN.clap"
7474
else
75-
echo "Skipping codesign — Developer ID Application not in keychain"
75+
echo "Skipping codesign — APPLICATION secret not set"
7676
fi
7777

7878
pkgbuild --root "$STAGE/vst" --install-location "/Library/Audio/Plug-Ins/VST" --identifier "${BUNDLE_BASE}.vst.pkg" --version "$VERSION" "$PKG_DIR/vst.pkg"
@@ -91,16 +91,23 @@ if [ "$PLATFORM" = "macOS" ]; then
9191
--version "$VERSION" \
9292
"$PKG_OUT.unsigned"
9393

94-
if security find-identity -v | grep -q "$DEV_INST_ID"; then
94+
if [ -n "${INSTALLER:-}" ]; then
9595
productsign --sign "$DEV_INST_ID" "$PKG_OUT.unsigned" "$PKG_OUT"
9696
rm "$PKG_OUT.unsigned"
9797
else
98-
echo "Skipping productsign — Developer ID Installer not in keychain"
98+
echo "Skipping productsign — INSTALLER secret not set"
9999
mv "$PKG_OUT.unsigned" "$PKG_OUT"
100100
fi
101101

102102
if [ -n "${APPLE_USER:-}" ] && [ -n "${APPLE_PASS:-}" ]; then
103-
xcrun notarytool submit --verbose --apple-id "$APPLE_USER" --password "$APPLE_PASS" --team-id "$TEAM_ID" --wait --timeout 30m "$PKG_OUT"
103+
SUBMISSION_OUTPUT=$(xcrun notarytool submit --verbose --apple-id "$APPLE_USER" --password "$APPLE_PASS" --team-id "$TEAM_ID" --wait --timeout 30m "$PKG_OUT" 2>&1) || NOTARY_FAILED=1
104+
echo "$SUBMISSION_OUTPUT"
105+
SUBMISSION_ID=$(echo "$SUBMISSION_OUTPUT" | awk "/^ id:/ { print \$2; exit }")
106+
if [ "${NOTARY_FAILED:-0}" = "1" ] && [ -n "$SUBMISSION_ID" ]; then
107+
echo "Notarization failed — fetching log for $SUBMISSION_ID"
108+
xcrun notarytool log "$SUBMISSION_ID" --apple-id "$APPLE_USER" --password "$APPLE_PASS" --team-id "$TEAM_ID" || true
109+
exit 1
110+
fi
104111
xcrun stapler staple "$PKG_OUT"
105112
else
106113
echo "Skipping notarization — APPLE_USER / APPLE_PASS not set"

0 commit comments

Comments
 (0)