diff --git a/build/scripts/build_macos.sh b/build/scripts/build_macos.sh index d5d0e29..afed596 100644 --- a/build/scripts/build_macos.sh +++ b/build/scripts/build_macos.sh @@ -338,7 +338,12 @@ notarize_app() { return 1 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 log_info "Uploading to Apple Notarization Service..." diff --git a/build/scripts/create_release.sh b/build/scripts/create_release.sh index 04b3885..312e739 100644 --- a/build/scripts/create_release.sh +++ b/build/scripts/create_release.sh @@ -59,6 +59,58 @@ for artifact in data["artifacts"]: 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 if [ -f "$ARTIFACT" ] && [ "${ARTIFACT##*.}" = "dmg" ]; then DMG_SIZE=$(du -m "$ARTIFACT" | cut -f1)