Skip to content

Commit 945cace

Browse files
committed
fix: use maxdepth to find top-level app Info.plist in appcast generation
find without maxdepth picked up a nested framework's Info.plist (e.g. Sparkle.framework) which lacks CFBundleVersion. Use maxdepth 3 to target only the top-level app bundle, with fallback defaults.
1 parent b94a006 commit 945cace

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,22 @@ jobs:
533533
X86_64_ED_SIG=$(echo "$X86_64_SIG" | sed -n 's/.*sparkle:edSignature="\([^"]*\)".*/\1/p')
534534
X86_64_LENGTH=$(echo "$X86_64_SIG" | sed -n 's/.*length="\([^"]*\)".*/\1/p')
535535
536-
# Extract version info from the app's Info.plist inside the ZIP
536+
# Extract version info from the top-level app's Info.plist inside the ZIP
537+
# Use -maxdepth 3 to avoid nested framework plists (e.g. Sparkle.framework)
537538
TEMP_DIR=$(mktemp -d)
538-
unzip -q "$ARM64_ZIP" "*/Contents/Info.plist" -d "$TEMP_DIR"
539-
INFO_PLIST=$(find "$TEMP_DIR" -name "Info.plist" -path "*/Contents/Info.plist" | head -1)
540-
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "$INFO_PLIST")
541-
SHORT_VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$INFO_PLIST")
542-
MIN_OS=$(/usr/libexec/PlistBuddy -c "Print :LSMinimumSystemVersion" "$INFO_PLIST" 2>/dev/null || echo "13.5")
539+
unzip -q "$ARM64_ZIP" -d "$TEMP_DIR"
540+
INFO_PLIST=$(find "$TEMP_DIR" -maxdepth 3 -path "*/Contents/Info.plist" | head -1)
541+
542+
if [ -n "$INFO_PLIST" ] && [ -f "$INFO_PLIST" ]; then
543+
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "$INFO_PLIST" 2>/dev/null || echo "1")
544+
SHORT_VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$INFO_PLIST" 2>/dev/null || echo "$VERSION")
545+
MIN_OS=$(/usr/libexec/PlistBuddy -c "Print :LSMinimumSystemVersion" "$INFO_PLIST" 2>/dev/null || echo "13.5")
546+
else
547+
echo "⚠️ Could not find app Info.plist in ZIP, using defaults from tag"
548+
BUILD_NUMBER="1"
549+
SHORT_VERSION="$VERSION"
550+
MIN_OS="13.5"
551+
fi
543552
rm -rf "$TEMP_DIR"
544553
545554
# Build appcast.xml with architecture-specific items (Sparkle 2 convention)

0 commit comments

Comments
 (0)