Skip to content

feat(release): ship a DMG and Velopack installers with in-app updates - #8

Merged
Harold Hunt (huntharo) merged 4 commits into
mainfrom
ci/velopack-dmg
Oct 30, 2026
Merged

Harold Hunt (huntharo) merged 4 commits into
mainfrom
ci/velopack-dmg

Conversation

@huntharo

@huntharo Harold Hunt (huntharo) commented Oct 29, 2026 •

Copy link
Copy Markdown

Brings PwrDisk's release packaging up to PwrRoute's: a macOS DMG, Velopack installers and update feeds for Windows x64 and ARM64, and an in-app updater. Targets main, on top of #2, #3 and #5.

Reading the diff: 8,591 of the ~13.8k added lines are licenses/velopack.txt, generated by scripts/release/velopack-notices.sh (the license notices for the Velopack binaries vpk adds to each install); skip it. The rest is about 5k lines, a third of them ported scripts and workflows.

What a release ships now

Platform Assets
macOS PwrDisk-<v>-universal.dmg (one app for Apple silicon and Intel, packed by vpk, Developer ID signed, notarized and stapled, DMG too), PwrDisk-osx-Portable.zip, nupkg, releases.osx.json feed
Windows x64 PwrDisk-win-Setup.exe, PwrDisk-win.msi (per user), PwrDisk-win-Portable.zip, nupkg, releases.win.json
Windows ARM64 the same with win-arm64: its own Velopack channel and feed
Linux unchanged tarball + install.sh, x86_64 and aarch64

Everything is signed in jobs that never check out or build source, and a release fails rather than ship unsigned.

Ported from PwrRoute

  • release.yml's prepare/sign split: unprivileged macos-prepare / windows-prepare build and hand over an archive whose SHA-256 travels as a job output; macos-sign (environment apple-signing, hosted macos-26) and windows-sign (environment windows-signing) verify both and pack with vpk. Release created at the end from the CHANGELOG.md section, as a Pre-release, with every asset and feed. Same environments, secret and variable names as Sign releases through the apple-signing and windows-signing environments #3.
  • preview-build.yml (label build-preview), and .github/workflows/README.md documenting the design.
  • scripts/release/: install-vpk.sh (pinned, SHA-512-verified vpk 1.2.161), vpk-pack-windows.ps1, macos-dmg.sh, dmg-layout.py (writes .DS_Store directly, no Finder), macos-signing.py (job-scoped keychain with restore-on-cleanup), macos_packaging_test.py, generate-dmg-background.swift, velopack-notices.sh.
  • packaging/dmg/ (background redrawn with the PwrDisk wordmark, "disks / space"), packaging/macos/PwrDisk.entitlements (none), licenses/velopack.txt.
  • App: velopack = "=1.2.161", updater.rs, update_channel.rs (the family's Stable/Beta × Latest/Prerelease slots, with their tests), github_releases.rs pointed at pwrdrvr/PwrDisk, Velopack's startup hook first in main.
  • cargo xtask release-check and CHANGELOG.md.

Adapted

  • Hosted runners only. PwrRoute builds macOS on self-hosted lab guests; this repo takes fork PRs, so every job is GitHub-hosted (macos-26 builds, on Xcode 26 so the Icon Composer icon from macOS: Icon Composer bundle icon and a Dock icon for unbundled runs (port of tobi/disktree#103) #7 compiles into the universal app, and the job fails if it is missing; another macos-26 signs, as PwrRoute signs).
  • Missing credentials fail the job. PwrRoute packs ad hoc/unsigned with a warning.
  • Windows ARM64 kept, as its own Velopack channel (win-arm64). Both architectures build on native runners and are packed and signed by one windows-sign job. The matrix prepare job emits one digest output per architecture; windows-sign refuses an empty one, and the preview workflow exercises the same hand-off.
  • Universal macOS: cargo xtask bundle --universal builds both targets and joins them with lipo; --app-only stops at the app for the sign job. Without it bundle also makes the DMG through the same macos-dmg.sh, so CI's macOS job now checks the DMG too. PWRDISK_VERSION stamps preview versions.
  • Volume icon is the app's own AppIcon.icns (drawn from the SVG), not a separate committed .icns.
  • Updater UI. PwrDisk has no settings window, so it gets a small Updates panel: Shift-U (plain u already goes up a level) or PwrDisk › Check for Updates… on macOS. It shows the version and whether this copy can update, the four channel slots (arrows + enter or click to pick; saved to update-channel.json beside the Power Efficiency preset), the last check's outcome, Check now, and Restart to update/switch once a download is ready. Tokens in ui.rs, state in state.rs, a window-harness test (the_updates_panel_picks_a_channel_and_keeps_the_keys) that also checks keys don't leak to the treemap behind it.
  • Apply on quit via cx.on_app_quit, so every quit path (menu, q, closing the window) installs a downloaded update; startup never auto-applies, as in PwrRoute, so a package held for a channel the user left is never installed.
  • Velopack notices regenerated to include the Windows ARM64 target; make install on macOS now uses --app-only.

Deliberately left out

  • PwrRoute's --require-icon-catalog flag — the release and preview jobs check the bundle for Assets.car and CFBundleIconName instead.
  • Winget/Homebrew audit stubs; the cache-sharing typecheck/test release jobs (CI layout differs; the release lints once and tests on each platform it builds).
  • Linux .deb — not trivial enough here (no package-linux task); Linux keeps the tarball. Velopack is not used on Linux (its only Linux output is an AppImage).
  • A full THIRD_PARTY_LICENSES for the app's own crates (cargo-about/deny) — PwrDisk didn't have one before; only Velopack's binaries' notices are added. Worth a follow-up.
  • Windows install/uninstall hooks: PwrDisk registers nothing with the system.

Carried from #3

Built on #3's reviewed release workflow; this keeps its rules in the new jobs: a dispatched run must start from the tag itself (checked in the first job), every action pinned to a commit SHA (including the new setup-dotnet and everything in preview-build.yml), the Windows signer compared by its simple name exactly (GetNameInfo(SimpleName) -cne "PwrDrvr LLC"), and no file contents through a PowerShell redirect (the Windows payload is copied from the prepare job's checkout).

The branch is ci/velopack-dmg: the repo already has a release branch, so release/… cannot exist.

Version

0.12.0: the next minor after disktree 0.11.0, the last upstream version the fork took, so versions keep ordering across the fork and nobody mistakes PwrDisk's first release for an upstream patch. CHANGELOG.md has its notes.

Verification

  • cargo xtask lint and cargo xtask test green locally (macOS), including the new harness test and the Python packaging tests (now part of cargo xtask test on Unix); actionlint + shellcheck clean.
  • cargo xtask bundle --universal locally: the ad hoc DMG mounts with PwrDisk.app (x86_64 + arm64, codesign --verify --deep --strict OK) and an Applications -> /Applications link, plus background, .DS_Store and volume icon.
  • vpk pack could not run locally (only a .NET preview SDK here), so the build-preview run on this PR proves it on hosted runners, through the same prepare → pack hand-off as the release, minus signing:
    • macOS: universal app → vpk pack (ad hoc) → DMG; the job mounts the DMG and checks PwrDisk.app (arm64 + x86_64, UpdateMac present, codesign --verify --deep --strict), the Applications link, background, .DS_Store and volume icon.
    • Windows: PwrDisk-win-Setup.exe, PwrDisk-win.msi, PwrDisk-win-Portable.zip, releases.win.json (x64) and PwrDisk-win-arm64-Setup.exe, PwrDisk-win-arm64.msi, PwrDisk-win-arm64-Portable.zip, releases.win-arm64.json (ARM64), with no file name shared between them; the per-architecture digest outputs of the matrix arrived intact.
  • The signed path (macos-sign, windows-sign, publish) can only run from a v* tag, so it first runs for real on the first release.

First release, for you

  1. Merge this.
  2. Tag v0.12.0 on main and push it (the tag must match Cargo.toml and CHANGELOG.md).
  3. Approve the apple-signing and windows-signing deployments when the run pauses.
  4. Install from the DMG and PwrDisk-win-Setup.exe from the resulting Pre-release, check them, then promote: gh release edit v0.12.0 -R pwrdrvr/PwrDisk --latest --prerelease=false. Installed copies on the default Stable · Latest channel only see promoted releases.

The first release has no delta (nothing to diff against); later ones get one automatically. The repo must stay public for the updater to read releases without a token.

Also fixes main's red CI: #7's bundle-macos-26 job was missing from #12's classifier job list, so Classify Changes failed. It is now gated on the classifier like the other jobs.

@huntharo Harold Hunt (huntharo) added the build-preview Build unsigned DMG and Windows installers for this PR label Oct 29, 2026
@huntharo
Harold Hunt (huntharo) force-pushed the ci/velopack-dmg branch 2 times, most recently from c2b95df to 32227ac Compare October 30, 2026 00:04
@huntharo
Harold Hunt (huntharo) changed the base branch from ci/signing-environments to main October 30, 2026 00:04
@huntharo Harold Hunt (huntharo) changed the title Ship a DMG and Velopack installers, with in-app updates feat(release): ship a DMG and Velopack installers with in-app updates Oct 30, 2026
Port PwrRoute's release packaging: a universal macOS app packed by vpk
and cut into a drag-to-install DMG, Windows x64 and ARM64 Setup.exe, MSI
and portable zip, and the Velopack update feeds. Builds run in
unprivileged prepare jobs on hosted runners; credentialed sign jobs never
check out source and fail without their credentials.

The app checks GitHub Releases, downloads in the background and applies
on quit or Restart to update; Shift-U opens an Updates panel with the
release channel. Releases are cut from CHANGELOG.md sections, starting at
0.12.0.
…perator

A bare command path does not expand $arch, so the Windows pack step
failed before vpk ran.
Refuse the restart while a removal runs, check again when a channel is
picked mid-check, read the Velopack manifest once, and reuse
widgets::ago for the last check's age.
#7 added bundle-macos-26 after #12's classifier test began listing every
CI job, so main's Classify Changes fails. The job runs unless the
classifier says non-code only, as its neighbours do.
@huntharo
Harold Hunt (huntharo) merged commit ee680cb into main Oct 30, 2026
14 checks passed
@huntharo
Harold Hunt (huntharo) deleted the ci/velopack-dmg branch November 9, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-preview Build unsigned DMG and Windows installers for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant