more Sparkle tests

This commit is contained in:
Micha
2025-11-25 19:15:25 +01:00
parent 24794a1d63
commit 05017ffd5e

View File

@@ -103,6 +103,46 @@ sign_update_artifacts() {
fi fi
} }
submit_for_notarization() {
local target="$1"
local label="$2"
echo "📝 Submitting ${label} for notarization..."
xcrun notarytool submit "$target" \
--apple-id "$NOTARY_APPLE_ID" \
--team-id "$NOTARY_TEAM_ID" \
--password "$NOTARY_PASSWORD" \
--wait
}
notarize_app_bundle() {
local bundle="$1"
local label="$2"
if [[ -z "${NOTARY_APPLE_ID:-}" || -z "${NOTARY_TEAM_ID:-}" || -z "${NOTARY_PASSWORD:-}" ]]; then
echo " Skipping notarization for ${label} (NOTARY_* variables not set)."
return 1
fi
local tmp_dir
tmp_dir="$(mktemp -d)"
local archive="$tmp_dir/$(basename "$bundle").zip"
ditto -c -k --keepParent "$bundle" "$archive"
submit_for_notarization "$archive" "$label"
xcrun stapler staple "$bundle"
rm -rf "$tmp_dir"
}
notarize_artifact() {
local artifact="$1"
local label="$2"
if [[ -z "${NOTARY_APPLE_ID:-}" || -z "${NOTARY_TEAM_ID:-}" || -z "${NOTARY_PASSWORD:-}" ]]; then
echo " Skipping notarization for ${label} (NOTARY_* variables not set)."
return 1
fi
submit_for_notarization "$artifact" "$label"
xcrun stapler staple "$artifact"
}
if [[ -f "$CREDENTIALS_FILE" ]]; then if [[ -f "$CREDENTIALS_FILE" ]]; then
set -a set -a
# shellcheck disable=SC1090 # shellcheck disable=SC1090
@@ -146,6 +186,8 @@ else
echo "⚠️ Skipping codesign (CODESIGN_IDENTITY not set)." echo "⚠️ Skipping codesign (CODESIGN_IDENTITY not set)."
fi fi
notarize_app_bundle "$APP_PATH" "iKeyMon.app"
STAGING_DIR=$(mktemp -d) STAGING_DIR=$(mktemp -d)
mkdir -p "$STAGING_DIR" mkdir -p "$STAGING_DIR"
cp -R "$APP_PATH" "$STAGING_DIR/" cp -R "$APP_PATH" "$STAGING_DIR/"
@@ -171,15 +213,9 @@ hdiutil create -volname "iKeyMon" -srcfolder "$STAGING_DIR" -ov -format UDZO "$A
sign_update_artifacts sign_update_artifacts
if [[ -n "${NOTARY_APPLE_ID:-}" && -n "${NOTARY_TEAM_ID:-}" && -n "${NOTARY_PASSWORD:-}" ]]; then if [[ -n "${NOTARY_APPLE_ID:-}" && -n "${NOTARY_TEAM_ID:-}" && -n "${NOTARY_PASSWORD:-}" ]]; then
echo "📝 Submitting DMG for notarization..." notarize_artifact "$ARTIFACTS_DIR/$DMG_NAME" "$DMG_NAME"
xcrun notarytool submit "$ARTIFACTS_DIR/$DMG_NAME" \
--apple-id "$NOTARY_APPLE_ID" \
--team-id "$NOTARY_TEAM_ID" \
--password "$NOTARY_PASSWORD" \
--wait
xcrun stapler staple "$ARTIFACTS_DIR/$DMG_NAME"
else else
echo "⚠️ Skipping notarization (NOTARY_* variables not set)." echo "⚠️ Skipping DMG notarization (NOTARY_* variables not set)."
fi fi
rm -rf "$STAGING_DIR" rm -rf "$STAGING_DIR"