Skip to content

feat(v3): add DMG packaging support - #5857

Merged
leaanthony merged 7 commits into
masterfrom
feature/dmg-support
Jul 31, 2026
Merged

leaanthony merged 7 commits into
masterfrom
feature/dmg-support

Conversation

@leaanthony

@leaanthony leaanthony commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds macOS DMG packaging to Wails v3 through the public github.com/leaanthony/dmg library.

  • Adds wails3 tool package --format dmg with configurable backgrounds, mounted-volume and DMG-file icons, window sizing, icon placement, and optional extra files.
  • Adds darwin:package:dmg / darwin:create:dmg Taskfile tasks and documents their configuration.
  • Bundles a Wails-branded default DMG background and a transparent custom DMG-file icon in every new project.
  • Uses a scaled default app icon only for generated projects; user-supplied app icons remain unmodified.

Validation

  • go test ./... from v3
  • Generated a fresh vanilla project using the public DMG module dependency.
  • Ran wails3 task darwin:package:dmg successfully.
  • Verified the generated DMG has the Finder custom-icon resource (icns ID -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

  • New Features
    • Added support for creating styled macOS DMG installers.
    • Added configurable DMG backgrounds, icons, Finder window dimensions, application placement, and optional additional files.
    • Added default DMG assets, including a background image and file icon.
  • Bug Fixes
    • Improved validation and error handling for malformed additional-file specifications.
  • Documentation
    • Updated macOS packaging guidance to use the built-in DMG packaging task instead of manual creation steps.

@github-actions github-actions Bot added Documentation Improvements or additions to documentation cli v3-alpha labels Jul 31, 2026
@leaanthony
leaanthony marked this pull request as ready for review July 31, 2026 08:00
Copilot AI review requested due to automatic review settings July 31, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ToolPackage using github.com/leaanthony/dmg/dmg and add addDMGFiles parsing + tests.
  • Add darwin:package:dmg / darwin:create:dmg Taskfile 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.

Comment on lines 83 to +87
return &flags.ToolPackage{
Format: "DEB",
ConfigPath: configPath,
ExecutableName: "myapp",
}, func() {
os.RemoveAll(filepath.Join(dir, "bin"))
}
Format: "DEB",
ConfigPath: configPath,
ExecutableName: "myapp",
}, func() {
Comment thread v3/internal/commands/tool_package.go Outdated
Comment on lines +46 to +50
opts := dmg.DefaultOptions(appPath, dmgPath)
opts.VolumeName = options.ExecutableName
windowWidth, windowHeight := options.DmgWindowWidth, options.DmgWindowHeight
if windowWidth <= 0 {
windowWidth = 540
@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 29f4aad1-b99a-4057-8af3-dfa8f4024a5f

📥 Commits

Reviewing files that changed from the base of the PR and between 0fad88c and eafbfca.

📒 Files selected for processing (1)
  • docs/src/content/docs/guides/build/macos.mdx

Walkthrough

This 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.

Changes

macOS DMG packaging

Layer / File(s) Summary
DMG packaging flags and Taskfile tasks
v3/internal/flags/package.go, v3/go.mod, v3/internal/commands/build_assets/darwin/Taskfile.yml
ToolPackage adds DMG icon, file, additional-file, and window-dimension fields. The Darwin Taskfile adds package:dmg and create:dmg tasks. The DMG builder dependency is added.
DMG option construction and build execution
v3/internal/commands/tool_package.go
DMG packaging builds validated options, maps optional name=path resources, applies default dimensions and icon positions, and calls dmg.Build.
DMG assets, tests, and documentation
v3/internal/commands/tool_package_test.go, v3/internal/commands/build-assets_test.go, v3/internal/commands/build_assets/appicon.icon/icon.json, docs/src/content/docs/guides/build/macos.mdx
Tests cover DMG options, defaults, file mappings, malformed specifications, and generated assets. The app icon scale changes. The macOS guide documents the new task and configuration. Existing package test formatting changes do not alter behavior.

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
Loading

Suggested labels: Enhancement, go, MacOS, size:L

Suggested reviewers: taliesin-ai

Poem

A rabbit packs icons in a row,
A polished DMG starts to grow.
Files and windows fit just right,
macOS builds now shine bright.
🐇📦✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description summarizes the feature and validation, but it omits the required issue reference, change type, test configuration, platform checklist, and repository checklist. Add the missing template sections, include a linked issue with Fixes #<issue number>, provide wails doctor output or environment details, and complete all applicable checkboxes.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: adding DMG packaging support to Wails v3.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/dmg-support

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 48a4e8e and b0ec82e.

⛔ Files ignored due to path filters (4)
  • v3/go.sum is excluded by !**/*.sum
  • v3/internal/commands/build_assets/appicon.png is excluded by !**/*.png
  • v3/internal/commands/build_assets/darwin/dmg-background.png is excluded by !**/*.png
  • v3/internal/commands/build_assets/darwin/dmg-file-icon.png is excluded by !**/*.png
📒 Files selected for processing (9)
  • docs/src/content/docs/guides/build/macos.mdx
  • v3/go.mod
  • v3/internal/commands/build-assets_test.go
  • v3/internal/commands/build_assets/appicon.icon/icon.json
  • v3/internal/commands/build_assets/darwin/Taskfile.yml
  • v3/internal/commands/build_assets/darwin/dmg-file-icon.icns
  • v3/internal/commands/tool_package.go
  • v3/internal/commands/tool_package_test.go
  • v3/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

Comment thread v3/internal/commands/tool_package.go Resolved
@leaanthony
leaanthony enabled auto-merge (squash) July 31, 2026 19:06
@leaanthony
leaanthony disabled auto-merge July 31, 2026 19:06
@leaanthony
leaanthony enabled auto-merge (squash) July 31, 2026 19:06
@leaanthony
leaanthony disabled auto-merge July 31, 2026 19:06
@leaanthony
leaanthony merged commit 81e52f1 into master Jul 31, 2026
49 checks passed
@leaanthony
leaanthony deleted the feature/dmg-support branch July 31, 2026 20:16
leaanthony pushed a commit that referenced this pull request Jul 31, 2026
@taliesin-ai taliesin-ai added v3 and removed v3-alpha labels Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Documentation Improvements or additions to documentation v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants