Skip to content

Build a macOS .dmg (universal), in CI and locally - #36

Merged
XyleMora merged 2 commits into
XyleMora:mainfrom
budenga:feat/macos-build
Nov 7, 2026
Merged

XyleMora merged 2 commits into
XyleMora:mainfrom
budenga:feat/macos-build

Conversation

@budenga

@budenga budenga commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Hi! Thanks for KiVi. I've been looking for something like it for KiCad reviews on GitHub. The README lists a macOS build under "Not done yet" and asks for testing feedback, so I tried it on a Mac. It turned out to need packaging and CI only. The Rust side already handles macOS (kicad.rs finds KiCad.app, SharedSupport/3dmodels and ~/Library/Preferences/kicad, and opens projects with open -a), and it compiles on macOS without any code changes.

What this PR changes

  • src-tauri/tauri.macos.conf.json (new), merged by Tauri on macOS like the Windows one. It sets a .dmg bundle with a minimum of macOS 11. Tauri generates KiVi.icns from the existing PNGs, so no new icon files are needed.

  • CI: a build-macos job on macos-26. Like the Linux and Windows builds, it runs only on tags and manual runs. It calls cargo tauri build --target universal-apple-darwin, which makes one .dmg for both Apple Silicon and Intel, uploads it as the kivi-macos artifact, and attaches it to releases. It uses the same KIVI_GITHUB_CLIENT_ID / KIVI_GITHUB_APP_SLUG variables as the other builds.

  • README / CLAUDE.md cover:

    • building and installing on macOS;
    • the Gatekeeper prompt;
    • where settings live (~/Library/WebKit/app.kivi.desktop);
    • the bundle_dmg.sh "Resource busy" workaround below;
    • what was tested.

    "macOS build" is also removed from "Not done yet".

Tested

On Apple Silicon, macOS 27, with KiCad 10.0.1 installed in /Applications/KiCad:

  • cargo tauri dev and the release .dmg, installed to /Applications. Both compile with no warnings.
  • Home, gallery, Remote project (greatscottgadgets/hackrf), and the schematic / PCB / 3D / BOM views. WebGL works fine in WKWebView.
  • Settings → KiCad with /Applications/KiCad. It found KiCad.app/Contents/MacOS/kicad, reported version 10.0.1, and listed KICAD10_3DMODEL_DIR (SharedSupport/3dmodels), KICAD10_3RD_PARTY and a custom variable from kicad_common.json.
  • Local project: 3D models loaded from the linked KiCad's library, and Open in KiCad worked.
  • GitHub sign-in (device flow) with my own GitHub App: the browser opened, the App installed, and the repositories I gave it access to appeared in the gallery.
  • The universal build locally: lipo shows x86_64 arm64.
  • CI on my fork, a manual run with all five jobs green (Tests, Rust tests, Linux, Windows, macOS): https://github.com/budenga/KiVi/actions/runs/42409454573. The macOS job takes about 18 minutes without a cache and produces KiVi_0.1.0_universal.dmg (13.6 MB).

Not tested / not included

  • Intel Macs. The universal binary builds, but I have no Intel Mac to run it on.
  • Code signing / notarisation. These need an Apple Developer account. The app is only ad-hoc signed, so on first launch macOS blocks it until System Settings → Privacy & Security → Open Anyway, which the README now explains. If you get a Developer ID later, Tauri can sign and notarise from CI with a few secrets (APPLE_CERTIFICATE, APPLE_ID, …); I left that out on purpose.
  • Local .dmg builds. bundle_dmg.sh's Finder styling sometimes left the disk image busy (hdiutil: couldn't unmount … Resource busy). CI=true cargo tauri build skips that step, and Actions sets CI already. I documented this in the README.

Note

I used Claude Code to help with this (hence the Co-Authored-By line), and I tested everything above myself on my Mac.

I'm happy to change anything: naming, the universal vs. per-architecture choice, wording, or splitting the docs out. 🙂

🤖 Generated with Claude Code

budenga and others added 2 commits November 7, 2026 20:41
- src-tauri/tauri.macos.conf.json (merged by Tauri on macOS): .dmg bundle,
  macOS 11+. Tauri makes the .icns from the existing PNGs.
- CI: build-macos job on macos-14, `cargo tauri build --target
  universal-apple-darwin` (Apple Silicon and Intel), kivi-macos artifact,
  attached to releases. Not code-signed or notarised.
- README and CLAUDE.md: building and installing on macOS, Gatekeeper,
  where settings live, the bundle_dmg.sh "Resource busy" workaround
  (CI=true), and what was tested by hand.

Tested on Apple Silicon (macOS 27, KiCad 10.0.1): dev and .dmg builds,
viewer, 3D, Settings → KiCad (KiCad.app, SharedSupport/3dmodels,
~/Library/Preferences/kicad), Open in KiCad, GitHub sign-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XyleMora

XyleMora commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Hi @budenga, thank you for being interested in KiVi project and thank you for your contribution!

@XyleMora
XyleMora self-requested a review November 7, 2026 22:37
@XyleMora
XyleMora merged commit effeb11 into XyleMora:main Nov 7, 2026
6 checks passed
@budenga

budenga commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @XyleMora for merging! When you cut the next release, the macOS .dmg should be attached automatically by the new build-macos job. Happy to help if anything goes wrong with it on the first tagged run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants