Repository navigation
feat(v3): add DMG packaging support - #5857
Conversation
There was a problem hiding this comment.
Pull request overview
Adds macOS DMG packaging support to Wails v3 by integrating the public github.com/leaanthony/dmg library, wiring it into wails3 tool package, and exposing template tasks + documentation for generating styled DMGs (including branded default assets and configurable window/icon/background settings).
Changes:
- Add DMG-specific packaging flags (background, volume/file icons, extra files, window sizing) to
wails3 tool package. - Implement DMG build path in
ToolPackageusinggithub.com/leaanthony/dmg/dmgand addaddDMGFilesparsing + tests. - Add
darwin:package:dmg/darwin:create:dmgTaskfile tasks and update macOS build docs to describe configuration.
Reviewed changes
Copilot reviewed 8 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| v3/internal/flags/package.go | Adds DMG-related CLI flags for configuring DMG appearance and contents. |
| v3/internal/commands/tool_package.go | Implements DMG creation via github.com/leaanthony/dmg/dmg, including window/icon layout and extra file support. |
| v3/internal/commands/tool_package_test.go | Adds unit tests for DMG extra-file parsing; updates existing package tests formatting. |
| v3/internal/commands/build-assets_test.go | Verifies DMG-branded assets are generated into new projects’ build assets. |
| v3/internal/commands/build_assets/darwin/Taskfile.yml | Adds package:dmg and create:dmg tasks and wires defaults for DMG configuration variables. |
| v3/internal/commands/build_assets/appicon.icon/icon.json | Adjusts the default app icon scale used for generated projects. |
| v3/go.mod | Adds dependency on github.com/leaanthony/dmg (pinned pseudo-version). |
| v3/go.sum | Adds checksums for the new github.com/leaanthony/dmg dependency. |
| docs/src/content/docs/guides/build/macos.mdx | Updates macOS guide to document new DMG tasks and configuration knobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return &flags.ToolPackage{ | ||
| Format: "DEB", | ||
| ConfigPath: configPath, | ||
| ExecutableName: "myapp", | ||
| }, func() { | ||
| os.RemoveAll(filepath.Join(dir, "bin")) | ||
| } | ||
| Format: "DEB", | ||
| ConfigPath: configPath, | ||
| ExecutableName: "myapp", | ||
| }, func() { |
| opts := dmg.DefaultOptions(appPath, dmgPath) | ||
| opts.VolumeName = options.ExecutableName | ||
| windowWidth, windowHeight := options.DmgWindowWidth, options.DmgWindowHeight | ||
| if windowWidth <= 0 { | ||
| windowWidth = 540 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThis change adds macOS DMG packaging support. It introduces DMG options, Darwin Taskfile tasks, external DMG builder integration, generated asset checks, packaging tests, and updated macOS build documentation. ChangesmacOS DMG packaging
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant DarwinTaskfile
participant ToolPackage
participant DMGBuilder
Developer->>DarwinTaskfile: run darwin:package:dmg
DarwinTaskfile->>ToolPackage: pass DMG options and generated assets
ToolPackage->>DMGBuilder: build validated DMG
DMGBuilder-->>Developer: write styled DMG output
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@v3/internal/commands/tool_package.go`:
- Around line 140-161: Update addDMGFiles to check whether each trimmed name
already exists in opts.Files before assigning it. Return a clear error for
duplicate or reserved names, including collisions such as the app bundle key or
“Applications,” while preserving the existing validation and file-stat behavior
for new entries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 4b8d3adc-d7a3-4284-b872-5b4bbdeafff0
⛔ Files ignored due to path filters (4)
v3/go.sumis excluded by!**/*.sumv3/internal/commands/build_assets/appicon.pngis excluded by!**/*.pngv3/internal/commands/build_assets/darwin/dmg-background.pngis excluded by!**/*.pngv3/internal/commands/build_assets/darwin/dmg-file-icon.pngis excluded by!**/*.png
📒 Files selected for processing (9)
docs/src/content/docs/guides/build/macos.mdxv3/go.modv3/internal/commands/build-assets_test.gov3/internal/commands/build_assets/appicon.icon/icon.jsonv3/internal/commands/build_assets/darwin/Taskfile.ymlv3/internal/commands/build_assets/darwin/dmg-file-icon.icnsv3/internal/commands/tool_package.gov3/internal/commands/tool_package_test.gov3/internal/flags/package.go
🚧 Files skipped from review as they are similar to previous changes (6)
- v3/internal/commands/build-assets_test.go
- v3/internal/commands/build_assets/appicon.icon/icon.json
- v3/internal/commands/build_assets/darwin/Taskfile.yml
- docs/src/content/docs/guides/build/macos.mdx
- v3/internal/flags/package.go
- v3/internal/commands/tool_package_test.go
👮 Files not reviewed due to content moderation or server errors (1)
- v3/internal/commands/build_assets/darwin/dmg-file-icon.icns
Summary
Adds macOS DMG packaging to Wails v3 through the public
github.com/leaanthony/dmglibrary.wails3 tool package --format dmgwith configurable backgrounds, mounted-volume and DMG-file icons, window sizing, icon placement, and optional extra files.darwin:package:dmg/darwin:create:dmgTaskfile tasks and documents their configuration.Validation
go test ./...fromv3wails3 task darwin:package:dmgsuccessfully.icnsID-16455).Dependency
Pins the public DMG library at
v0.0.0-20260731074841-5c28840cf819, including its Finder custom DMG-file icon resource-ID fix.Summary by CodeRabbit