feat: Add icon generation script and update README with new functionality
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
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:
parent
032d9e6c31
commit
3f9fa06fbd
6 changed files with 204 additions and 17 deletions
|
|
@ -274,39 +274,50 @@ create_dmg() {
|
|||
else
|
||||
log_warning "create-dmg not found, using hdiutil (less stylish)"
|
||||
log_info "For professional DMG: brew install create-dmg"
|
||||
|
||||
# Create temporary DMG directory structure
|
||||
DMG_TEMP="$TEMP_BUILD/dmg_contents"
|
||||
mkdir -p "$DMG_TEMP"
|
||||
|
||||
# Copy app bundle
|
||||
cp -r "$DIST_DIR/$APP_NAME.app" "$DMG_TEMP/"
|
||||
|
||||
# Create symlink to Applications folder
|
||||
ln -s /Applications "$DMG_TEMP/Applications"
|
||||
|
||||
# Build a small, HFS+ staging image first and then convert to
|
||||
# compressed UDZO. This avoids oversized APFS container images.
|
||||
# Build a writable HFS+ staging image, mount it, and copy the
|
||||
# app bundle with ditto so symlinks are preserved exactly.
|
||||
STAGING_DMG="$TEMP_BUILD/${APP_NAME}-staging.dmg"
|
||||
STAGING_MOUNT="$TEMP_BUILD/dmg_mount"
|
||||
STAGING_EMPTY="$TEMP_BUILD/dmg_empty"
|
||||
rm -f "$STAGING_DMG"
|
||||
rm -rf "$STAGING_MOUNT"
|
||||
rm -rf "$STAGING_EMPTY"
|
||||
mkdir -p "$STAGING_MOUNT"
|
||||
mkdir -p "$STAGING_EMPTY"
|
||||
|
||||
APP_SIZE_KB=$(du -sk "$DIST_DIR/$APP_NAME.app" | awk '{print $1}')
|
||||
DMG_SIZE_KB=$((APP_SIZE_KB + 512000))
|
||||
|
||||
hdiutil create \
|
||||
-volname "$DMG_VOLUME_NAME" \
|
||||
-srcfolder "$DMG_TEMP" \
|
||||
-size "${DMG_SIZE_KB}k" \
|
||||
-fs HFS+ \
|
||||
-fsargs "-c c=64,a=16,e=16" \
|
||||
-volname "$DMG_VOLUME_NAME" \
|
||||
-format UDRW \
|
||||
-srcfolder "$STAGING_EMPTY" \
|
||||
-ov \
|
||||
"$STAGING_DMG"
|
||||
|
||||
hdiutil attach "$STAGING_DMG" \
|
||||
-mountpoint "$STAGING_MOUNT" \
|
||||
-nobrowse \
|
||||
-noverify \
|
||||
-noautoopen
|
||||
|
||||
ditto "$DIST_DIR/$APP_NAME.app" "$STAGING_MOUNT/$APP_NAME.app"
|
||||
ln -s /Applications "$STAGING_MOUNT/Applications"
|
||||
|
||||
hdiutil detach "$STAGING_MOUNT"
|
||||
|
||||
hdiutil convert "$STAGING_DMG" \
|
||||
-format UDZO \
|
||||
-imagekey zlib-level=9 \
|
||||
-o "$DMG_FILE"
|
||||
|
||||
|
||||
# Clean up
|
||||
rm -f "$STAGING_DMG"
|
||||
rm -rf "$DMG_TEMP"
|
||||
rm -rf "$STAGING_MOUNT"
|
||||
rm -rf "$STAGING_EMPTY"
|
||||
fi
|
||||
|
||||
if [ ! -f "$DMG_FILE" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue