ci: replace simple DMG with proper macOS .pkg installer wizard#115
Conversation
- 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.
📝 WalkthroughWalkthroughAdds macOS installer resources and distribution XML to produce a distribution-style ChangesInstaller packaging and CI build flow
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
…d Windows NSIS fix
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
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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
📒 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.ymlCHANGELOG.md
- 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
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/release.yml (1)
194-223:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winThis 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 fromrun: |, 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 + EOFRun this to confirm the workflow parses and to inspect the
runblock 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
📒 Files selected for processing (2)
.github/workflows/release.ymlCHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG.md
Problem
The previous macOS release artifact was a plain DMG containing a binary + a shell script. Users had to manually run
install.shin the terminal — no wizard, no location picker, no native installer experience.Solution
Replace the
hdiutil-only approach with Apple's native installer toolchain:pkgbuild.pkg— defines the payload (binary →/usr/local/bin) and metadataproductbuildhdiutil.pkgin a DMG for download (mount → double-click → wizard)User experience
Users now get the same installer wizard flow as JDK:
What's installed
deepdiffdbbinary →/usr/local/bin/deepdiffdbon the selected volume. Immediately available in any new shell — no PATH changes required.Also fixed
Windows
makensisnot found error — Chocolatey's PATH update doesn't propagate to later GitHub Actions steps. Fixed by appendingC:/Program Files (x86)/NSISto$GITHUB_PATHafterchoco install nsis.Files added
Test plan
v*tag and verifydeepdiff-db-vX.Y.Z-darwin-amd64.dmganddarwin-arm64.dmgappear in the release.pkgfile.pkg— verify the wizard opens with Welcome / Read Me / Destination / Install / Summary screensdeepdiffdb --versionworks in a new terminalmakensis not founderrorSummary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores