feat(ci): build styled macOS DMG headlessly via dmgbuild (#189) #222

Merged
gronod merged 1 commits from feat/headless-dmg-dmgbuild into development 2026-09-07 18:06:40 +01:00
Owner

Summary

Restores the custom DMG background image, window size, and icon positioning in macOS releases without relying on Finder AppleScript GUI automation (resolving #189).

Background & Root Cause

In CI environments, running create-dmg with Finder AppleScript (TAURI_BUNDLER_DMG_IGNORE_CI="true") causes a fatal 120s timeout because the CI runner daemon lacks TCC automation permissions to control Finder. Conversely, running with --skip-jenkins (CI="true") disables AppleScript and omits writing .DS_Store, producing a plain DMG without custom layout or background art.

Solution

  1. scripts/build-dmg.py:
    • Uses dmgbuild (pure-Python, ~100 KB total dependencies) to package ICCery.app into ICCery.dmg.
    • Directly constructs the binary .DS_Store file with window dimensions (660x400), icon coordinates (ICCery.app @ 180, 220, /Applications @ 480, 220), and background image alias.
    • Automatically supports Retina displays by generating a multi-resolution HiDPI TIFF combining dmg-background.png (1x) and dmg-background@2x.png (2x).
    • Requires zero AppleScript, zero Finder interaction, and zero GUI permissions; executes in ~5 seconds headlessly.
  2. Workflow Integration:
    • Updated .gitea/workflows/build-macos.yml and .github/workflows/build-macos.yml to package the .app bundle using scripts/build-dmg.py inside an isolated runner virtualenv.
### Summary Restores the custom DMG background image, window size, and icon positioning in macOS releases without relying on Finder AppleScript GUI automation (resolving [#189](https://git.i3omb.com/gronod/ICCery/issues/189)). #### Background & Root Cause In CI environments, running `create-dmg` with Finder AppleScript (`TAURI_BUNDLER_DMG_IGNORE_CI="true"`) causes a fatal 120s timeout because the CI runner daemon lacks TCC automation permissions to control Finder. Conversely, running with `--skip-jenkins` (`CI="true"`) disables AppleScript and omits writing `.DS_Store`, producing a plain DMG without custom layout or background art. #### Solution 1. **`scripts/build-dmg.py`**: - Uses `dmgbuild` (pure-Python, ~100 KB total dependencies) to package `ICCery.app` into `ICCery.dmg`. - Directly constructs the binary `.DS_Store` file with window dimensions (`660x400`), icon coordinates (`ICCery.app` @ `180, 220`, `/Applications` @ `480, 220`), and background image alias. - Automatically supports Retina displays by generating a multi-resolution HiDPI TIFF combining `dmg-background.png` (1x) and `dmg-background@2x.png` (2x). - Requires zero AppleScript, zero Finder interaction, and zero GUI permissions; executes in ~5 seconds headlessly. 2. **Workflow Integration**: - Updated `.gitea/workflows/build-macos.yml` and `.github/workflows/build-macos.yml` to package the `.app` bundle using `scripts/build-dmg.py` inside an isolated runner virtualenv.
gronod added 1 commit 2026-09-06 22:04:44 +01:00
feat(ci): build styled macOS DMG headlessly via dmgbuild (#189)
Build Windows Packages / Build Windows (push) Canceled after 10s
Build Linux Packages / Build Linux (push) Canceled after 14s
Build macOS Packages / Build macOS (Intel) (push) Successful in 10m34s
Build macOS Packages / Build macOS (Apple Silicon) (push) Successful in 10m43s
6976ced610
- Add scripts/build-dmg.py using dmgbuild to generate DMGs with custom background art and icon locations without Finder AppleScript.
- Update .gitea/workflows/build-macos.yml and .github/workflows/build-macos.yml to package the .app bundle using dmgbuild in a headless virtual environment.
- Resolves missing DMG background in CI while preventing AppleScript GUI automation timeouts.
gronod merged commit 9cc87ca295 into development 2026-09-07 18:06:40 +01:00
gronod deleted branch feat/headless-dmg-dmgbuild 2026-09-07 18:06:40 +01:00
Sign in to join this conversation.