Skip to content

Add 'container-compose update' self-update command#10

Merged
flaticols merged 1 commit into
mainfrom
feat/self-update
Jun 21, 2026
Merged

Add 'container-compose update' self-update command#10
flaticols merged 1 commit into
mainfrom
feat/self-update

Conversation

@flaticols

Copy link
Copy Markdown
Owner

Smooth in-place updates without an external package manager.

What

  • container compose update — fetches the latest GitHub Release, downloads the signed + notarized .pkg, verifies its signature (pkgutil --check-signature), and installs it via sudo installer (which places the plugin under /usr/local/libexec/container-plugins/ and prompts for admin).
  • --check reports whether a newer version exists without installing; --force installs even if it looks up to date (handy for dev builds).
  • Works no matter how it was installed (no Homebrew/tap dependency).

Why not Homebrew

A brew formula can't place the plugin where container looks (outside brew's prefix). A cask installing the .pkg would work but needs a maintained tap. A built-in updater is self-contained and verifies the signature itself. (A cask+tap can still be added later for brew users.)

Tests

  • New SemVer comparator (prerelease sorts before the final release) with unit tests in a new container-composeTests target. 28 tests pass.
  • update --check verified manually against the live Releases API (dev build vs v0.0.6).
  • The download/verify/installer path isn't exercised in CI (needs network + admin); the read/compare path is.

Run gh workflow run release.yml -f version=X.Y.Z to ship a release the updater can find.

Checks the latest GitHub Release, downloads the signed + notarized .pkg, verifies
its signature (pkgutil --check-signature), and installs it via the macOS installer
(which places the plugin correctly and prompts for admin). --check reports without
installing; --force overrides the up-to-date guard. Works regardless of how the
binary was installed.

Adds a SemVer comparator (prerelease sorts before the final release) with unit
tests, and a container-composeTests target.
@flaticols flaticols merged commit edc6664 into main Jun 21, 2026
1 check passed
@flaticols flaticols deleted the feat/self-update branch June 21, 2026 13:44
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.

1 participant