feat: Add validation for macOS installer entries and enhance error handling in release creation script
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions

This commit is contained in:
claudi 2026-04-14 14:58:13 +02:00
parent d6f4140947
commit 93316c7e2f
2 changed files with 58 additions and 1 deletions

View file

@ -338,7 +338,12 @@ notarize_app() {
return 1 return 1
fi fi
DMG_FILE="$DIST_DIR/${APP_NAME}-${VERSION}.dmg" DMG_FILE="$DIST_DIR/${APP_NAME}-${VERSION}-macos-universal.dmg"
if [ ! -f "$DMG_FILE" ]; then
log_error "DMG for notarization not found: $DMG_FILE"
return 1
fi
# Upload for notarization # Upload for notarization
log_info "Uploading to Apple Notarization Service..." log_info "Uploading to Apple Notarization Service..."

View file

@ -59,6 +59,58 @@ for artifact in data["artifacts"]:
PY PY
) )
VALIDATION_RESULT=$(python3 - "$LOCAL_DATA_OUTPUT" "$LOCAL_MANIFEST_OUTPUT" <<'PY'
import json
import sys
from pathlib import Path
data = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
manifest = json.loads(Path(sys.argv[2]).read_text(encoding="utf-8"))
selected_brands = data.get("brands", [])
manifest_brands = manifest.get("brands", {})
missing = []
for brand_id in selected_brands:
platform_entry = manifest_brands.get(brand_id, {}).get("macos-universal", {})
installer_name = platform_entry.get("installer", "")
if not installer_name:
missing.append(brand_id)
if missing:
print("MISSING:" + ",".join(missing))
else:
print("OK")
PY
)
if [[ "$VALIDATION_RESULT" == MISSING:* ]]; then
MISSING_BRANDS="${VALIDATION_RESULT#MISSING:}"
echo "ERROR: release-manifest.json is missing macos-universal installer entries for brand(s): $MISSING_BRANDS"
echo "Build the missing brand(s) first or check artifact naming/version before creating the release."
exit 1
fi
if [ ${#BRANDS[@]} -gt 0 ]; then
FOUND_BRANDS_CSV=$(python3 - "$LOCAL_DATA_OUTPUT" <<'PY'
import json
import sys
from pathlib import Path
data = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
print(",".join(data.get("brands", [])))
PY
)
for REQUESTED_BRAND in "${BRANDS[@]}"; do
if [[ ",$FOUND_BRANDS_CSV," != *",$REQUESTED_BRAND,"* ]]; then
echo "ERROR: Requested brand '$REQUESTED_BRAND' has no local macOS artifact for version $VERSION"
echo "Run build/scripts/build_macos.sh --brand $REQUESTED_BRAND first, then retry release creation."
exit 1
fi
done
fi
for ARTIFACT in "${ARTIFACTS[@]}"; do for ARTIFACT in "${ARTIFACTS[@]}"; do
if [ -f "$ARTIFACT" ] && [ "${ARTIFACT##*.}" = "dmg" ]; then if [ -f "$ARTIFACT" ] && [ "${ARTIFACT##*.}" = "dmg" ]; then
DMG_SIZE=$(du -m "$ARTIFACT" | cut -f1) DMG_SIZE=$(du -m "$ARTIFACT" | cut -f1)