Skip to content

ci: replace simple DMG with proper macOS .pkg installer wizard#115

Merged
iamvirul merged 5 commits into
mainfrom
feature/macos-pkg-installer
May 3, 2026
Merged

ci: replace simple DMG with proper macOS .pkg installer wizard#115
iamvirul merged 5 commits into
mainfrom
feature/macos-pkg-installer

Conversation

@iamvirul

@iamvirul iamvirul commented May 3, 2026

Copy link
Copy Markdown
Owner

Problem

The previous macOS release artifact was a plain DMG containing a binary + a shell script. Users had to manually run install.sh in the terminal — no wizard, no location picker, no native installer experience.

Solution

Replace the hdiutil-only approach with Apple's native installer toolchain:

Tool Role
pkgbuild Creates the component .pkg — defines the payload (binary → /usr/local/bin) and metadata
productbuild Wraps the component in a distribution package with the full installer wizard UI
hdiutil Wraps the .pkg in a DMG for download (mount → double-click → wizard)

User experience

Users now get the same installer wizard flow as JDK:

  1. Introduction — welcome screen explaining what will be installed
  2. Read Me — quick-start guide with supported databases
  3. Destination Select — pick which disk to install on
  4. Installation Type — standard install summary
  5. Install — progress bar, requires admin password
  6. Summary — conclusion screen with first-run instructions

What's installed

deepdiffdb binary → /usr/local/bin/deepdiffdb on the selected volume. Immediately available in any new shell — no PATH changes required.

Also fixed

Windows makensis not found error — Chocolatey's PATH update doesn't propagate to later GitHub Actions steps. Fixed by appending C:/Program Files (x86)/NSIS to $GITHUB_PATH after choco install nsis.

Files added

.github/macos-installer/
  distribution.xml   # installer-gui-script with __APP_VERSION__ placeholder
  welcome.html       # intro screen
  readme.html        # quick-start guide
  conclusion.html    # post-install screen

Test plan

  • Push a v* tag and verify deepdiff-db-vX.Y.Z-darwin-amd64.dmg and darwin-arm64.dmg appear in the release
  • Mount the DMG — verify it contains a single .pkg file
  • Double-click the .pkg — verify the wizard opens with Welcome / Read Me / Destination / Install / Summary screens
  • Complete install — verify deepdiffdb --version works in a new terminal
  • Verify Windows installer builds and uploads without the makensis not found error

Summary by CodeRabbit

  • New Features

    • Added macOS package installer wizard with welcome, quick-start/readme, and completion pages
    • Enhanced Windows installer UI with updated welcome/finish screens
  • Bug Fixes

    • Fixed Windows installer build path resolution so NSIS is found during CI
  • Documentation

    • Updated CHANGELOG for v1.4.2
  • Chores

    • CI/workflow updated to build macOS .pkg and adjust DMG staging and NSIS packaging steps

- Switch from hdiutil-only DMG to pkgbuild + productbuild pipeline.
  Users now get a real installer wizard (intro, readme, destination
  select, progress, conclusion) identical to what JDK ships.
- Payload installs deepdiffdb to /usr/local/bin on the chosen volume.
- Distribution XML references welcome.html, readme.html, and
  conclusion.html from .github/macos-installer/ for a polished UI.
- Component .pkg is wrapped in a DMG for a familiar download experience
  (mount DMG → double-click .pkg → wizard launches).
- Fix Windows: append NSIS install dir to GITHUB_PATH after choco so
  makensis is resolved in subsequent steps.
@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds macOS installer resources and distribution XML to produce a distribution-style .pkg, updates the Windows NSIS installer UI, modifies the release workflow to build/package these installers (and fix NSIS path), and updates the changelog for v1.4.2.

Changes

Installer packaging and CI build flow

Layer / File(s) Summary
Installer UI pages
.github/macos-installer/welcome.html, .github/macos-installer/readme.html, .github/macos-installer/conclusion.html
Adds three static HTML pages used as the macOS installer wizard Welcome, Readme/Quick-start, and Conclusion screens.
macOS Distribution descriptor
.github/macos-installer/distribution.xml
Introduces Distribution XML referencing deepdiffdb-component.pkg, custom pages, install domains/options, and build-time placeholders __APP_VERSION__/__APP_TITLE__.
macOS PKG build steps
.github/workflows/release.yml (macos-pkg section)
New workflow steps: create payload layout, run pkgbuild to make component package, generate distribution.xml from placeholders, copy HTML resources into resources dir, run productbuild to produce distribution .pkg, and stage only the .pkg into the DMG stage.
DMG staging changes
.github/workflows/release.yml (dmg stage)
DMG creation now stages the generated .pkg only (removes previous staging of binary/README/install helper).
Windows NSIS UI & script polish
.github/windows-installer.nsi
Switches to Modern UI 2 (MUI2.nsh), sets welcome/finish text including documentation link, reorganizes header, and improves helper function comments; core helper logic unchanged.
Windows NSIS build wiring
.github/workflows/release.yml (Windows steps)
After installing NSIS via Chocolatey, appends C:/Program Files (x86)/NSIS to GITHUB_PATH, creates readme.txt resource for the installer, and changes the NSIS compile step to run under bash while invoking makensis.
Release notes
CHANGELOG.md
Adds v1.4.2 entry documenting macOS .pkg installer wizard and Windows makensis path fix; shortens v1.4.1 macOS note and updates compare links.

Sequence Diagram(s)

sequenceDiagram
    participant CI as GitHub Actions (macOS job)
    participant Builder as pkgbuild/productbuild
    participant Resources as repo /.github/macos-installer
    participant DMG as hdiutil / dmg-stage
    CI->>Resources: copy HTML pages & generate distribution.xml (__APP_VERSION__/__APP_TITLE__)
    CI->>Builder: run pkgbuild -> create component .pkg
    CI->>Builder: run productbuild with distribution.xml -> produce distribution .pkg
    CI->>DMG: stage generated .pkg into dmg-stage
    CI->>DMG: run hdiutil to create DMG from dmg-stage
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰
I hopped through build and plated .pkg delight,
HTML pages glowing in installer light,
Windows polished with a modern UI cheer,
CI hums, artifacts appear,
Hooray — installs now spring to flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: replacing a simple DMG with a proper macOS .pkg installer wizard, which aligns with the substantial refactoring of the macOS release pipeline shown in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/macos-pkg-installer

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@iamvirul iamvirul changed the base branch from feature/macos-dmg-release to main May 3, 2026 12:32
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 3, 2026
Replace bare Page directory/instfiles with NSIS Modern UI 2 pages:
  Welcome → Read Me → Directory → Installing → Finish

- Welcome page shows app name, version, and one-line description
- Read Me page displays readme.txt (generated by workflow at build time)
  with quick-start commands, supported databases, and docs link
- Directory page lets user choose install location (default %ProgramFiles%)
- Finish page shows first-run instructions and a link to open the docs
- Uninstaller gets Confirm + progress pages via MUI_UNPAGE_*
- MUI2 is bundled with NSIS — no external plugins required
@iamvirul iamvirul self-assigned this May 3, 2026
@codecov

codecov Bot commented May 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 194-221: The heredoc block starting at "cat > readme.txt << 'EOF'"
is breaking YAML parsing because it's an unindented block; change the heredoc to
a strip-leading-tabs form by using <<-'EOF' instead of << 'EOF' and then indent
the heredoc content using tabs (not spaces) so YAML remains valid while the
generated readme.txt has no extra leading spaces; update the "cat > readme.txt
<< 'EOF'" invocation to "cat > readme.txt <<-'EOF'" and re-indent the block with
tabs.

In `@CHANGELOG.md`:
- Around line 503-505: Update the `[Unreleased]` compare link so it uses the
latest released tag (`v1.4.2`) as the base instead of `v1.4.0`; locate the
`[Unreleased]` entry in CHANGELOG.md and change its URL from
".../compare/v1.4.0...HEAD" to ".../compare/v1.4.2...HEAD" so subsequent diffs
are calculated against v1.4.2.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b77d412-c9e9-469b-bc2d-46fb24eba614

📥 Commits

Reviewing files that changed from the base of the PR and between 6154613 and 7af2527.

📒 Files selected for processing (7)
  • .github/macos-installer/conclusion.html
  • .github/macos-installer/distribution.xml
  • .github/macos-installer/readme.html
  • .github/macos-installer/welcome.html
  • .github/windows-installer.nsi
  • .github/workflows/release.yml
  • CHANGELOG.md

Comment thread .github/workflows/release.yml Outdated
Comment thread CHANGELOG.md Outdated
- Use <<-'EOF' heredoc in Windows NSIS prepare step so tab-indented
  content is stripped correctly and YAML indentation doesn't bleed
  into the generated readme.txt
- Update [Unreleased] compare link base from v1.4.0 to v1.4.2

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

♻️ Duplicate comments (1)
.github/workflows/release.yml (1)

194-223: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

This heredoc still breaks workflow parsing.

These heredoc content lines start with literal tabs inside a YAML block scalar, so the workflow is invalid before bash ever sees <<-'EOF'. GitHub already strips the block's common space indentation from run: |, so the safe fix here is to keep normal space indentation in YAML and use a plain quoted heredoc instead.

🛠️ Proposed fix
-          # <<-'EOF' strips leading tabs so YAML indentation doesn't bleed into
-          # the generated file; content lines below are indented with tabs.
-          cat > readme.txt <<-'EOF'
-					DeepDiff DB - Quick Start
-					=========================
-
-					After installation, open a new Command Prompt or PowerShell window and run:
-
-					    deepdiffdb --version
-
-					Create a config file:
-
-					    deepdiffdb init
-
-					Run your first diff:
-
-					    deepdiffdb diff --html
-
-					Supported Databases
-					-------------------
-					  MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle Database
-
-					Documentation
-					-------------
-					  https://iamvirul.github.io/deepdiff-db/
-
-					Source Code
-					-----------
-					  https://github.com/iamvirul/deepdiff-db
-					EOF
+          # GitHub strips this block's common leading spaces before bash runs it,
+          # so a normal quoted heredoc keeps the generated file clean.
+          cat > readme.txt <<'EOF'
+          DeepDiff DB - Quick Start
+          =========================
+
+          After installation, open a new Command Prompt or PowerShell window and run:
+
+              deepdiffdb --version
+
+          Create a config file:
+
+              deepdiffdb init
+
+          Run your first diff:
+
+              deepdiffdb diff --html
+
+          Supported Databases
+          -------------------
+            MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle Database
+
+          Documentation
+          -------------
+            https://iamvirul.github.io/deepdiff-db/
+
+          Source Code
+          -----------
+            https://github.com/iamvirul/deepdiff-db
+          EOF

Run this to confirm the workflow parses and to inspect the run block exactly as YAML sees it:

#!/bin/bash
set -euo pipefail

python - <<'PY'
from pathlib import Path
import sys, subprocess
try:
    import yaml
except Exception:
    subprocess.check_call([sys.executable, "-m", "pip", "install", "--quiet", "pyyaml"])
    import yaml

text = Path(".github/workflows/release.yml").read_text(encoding="utf-8")
data = yaml.safe_load(text)
print("YAML parse OK")

step = next(
    s for s in data["jobs"]["windows-installer"]["steps"]
    if s.get("name") == "Prepare NSIS script and resources"
)
print("--- extracted run block ---")
for i, line in enumerate(step["run"].splitlines(), 1):
    if 9 <= i <= 40:
        print(f"{i:02d}: {line!r}")
PY
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 194 - 223, The heredoc in the
"Prepare NSIS script and resources" run block uses literal tabs and a <<-'EOF'
which breaks YAML parsing; replace the tab-indented lines with normal space
indentation inside the YAML run: block and switch to a plain quoted heredoc
(e.g. <<"EOF") so YAML doesn't see leading tabs as content, ensuring the cat >
readme.txt <<-'EOF' section (the heredoc block shown) uses spaces and a quoted
delimiter so the workflow YAML parses correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/release.yml:
- Around line 194-223: The heredoc in the "Prepare NSIS script and resources"
run block uses literal tabs and a <<-'EOF' which breaks YAML parsing; replace
the tab-indented lines with normal space indentation inside the YAML run: block
and switch to a plain quoted heredoc (e.g. <<"EOF") so YAML doesn't see leading
tabs as content, ensuring the cat > readme.txt <<-'EOF' section (the heredoc
block shown) uses spaces and a quoted delimiter so the workflow YAML parses
correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 042731f3-b61c-4c26-ba03-0976e244b6e8

📥 Commits

Reviewing files that changed from the base of the PR and between 7af2527 and 4268d17.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

@iamvirul iamvirul merged commit 7077c90 into main May 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github-actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant