@@ -305,6 +305,40 @@ jobs:
305305 fi
306306
307307 codesign --verify --deep --strict --verbose=4 "${MOUNT_DIR}/${APP_DIR}"
308+ spctl --assess --type execute --verbose=4 "${MOUNT_DIR}/${APP_DIR}" || true
309+
310+ - name : Notarize and staple macOS DMG
311+ if : matrix.os == 'macos-latest'
312+ shell : bash
313+ env :
314+ APPLE_ID : ${{ secrets.APPLE_ID }}
315+ APPLE_APP_SPECIFIC_PASSWORD : ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
316+ APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
317+ run : |
318+ set -euo pipefail
319+
320+ DMG_NAME="Companion-macos-${{ matrix.arch }}.dmg"
321+
322+ if [[ -z "${APPLE_ID:-}" || -z "${APPLE_APP_SPECIFIC_PASSWORD:-}" || -z "${APPLE_TEAM_ID:-}" ]]; then
323+ if [[ "${GITHUB_REF:-}" == refs/tags/release-v* ]]; then
324+ echo "ERROR: Missing notarization secrets for tagged release."
325+ echo "Required: APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, APPLE_TEAM_ID"
326+ exit 1
327+ fi
328+
329+ echo "No notarization credentials configured; skipping notarization."
330+ exit 0
331+ fi
332+
333+ xcrun notarytool submit "${DMG_NAME}" \
334+ --apple-id "${APPLE_ID}" \
335+ --password "${APPLE_APP_SPECIFIC_PASSWORD}" \
336+ --team-id "${APPLE_TEAM_ID}" \
337+ --wait
338+
339+ xcrun stapler staple "${DMG_NAME}"
340+ xcrun stapler validate "${DMG_NAME}"
341+ spctl --assess --type open --verbose=4 "${DMG_NAME}" || true
308342
309343 # ----- Linux packaging -----
310344 - name : Linux - zip publish folder
0 commit comments