Add CPack DEB packaging + release workflow (.deb per distro)#32
Open
gilesw wants to merge 5 commits into
Open
Conversation
added 5 commits
June 21, 2026 20:39
… tarball The existing CI builds keyfinder-cli but doesn't publish anything, forcing downstream consumers (Ansible roles, package managers, etc.) to rebuild both libkeyfinder and keyfinder-cli from source on every host. This adds a separate workflow that, on tag push, builds keyfinder-cli against a pinned libkeyfinder (v2.2.6) and bundles both binaries into a tarball uploaded as a GitHub release asset, with a SHA-256 sum file. The bundled libkeyfinder.so means consumers only need the standard FFmpeg runtime libs (usually already present via `ffmpeg`). Layout in the tarball matches a standard `/usr/local` prefix so installation is `tar xzf` + copy + ldconfig. Existing per-push build job is untouched.
…mpat Ubuntu 24.04 ships FFmpeg 6 (libavformat.so.60); Debian trixie ships FFmpeg 7 (libavformat.so.61). A binary built on one won't load on the other. Build inside per-distro containers so consumers can pick the tarball whose ABI matches their host. Tarballs are now suffixed -ubuntu24 / -debian13 to make the choice explicit; old single-tarball assets stay on the prior release.
CMakeLists gains a CPack DEB block — CPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON derives Depends: straight from dpkg-shlibdeps against the built binary, so the right libavformatN / libfftw3-3 / etc. names land per build env. Workflow now: - builds libkeyfinder STATIC (-DBUILD_SHARED_LIBS=OFF -fPIC) so it links into the keyfinder-cli binary, - runs `cpack -G DEB` after the build, - uploads a single self-contained .deb per matrix entry (ubuntu24, debian13) plus its sha256. Consumers install with `apt install ./keyfinder-cli_*_amd64.deb` — no ldconfig handler, no /usr/local layout surgery, FFmpeg deps pulled in through apt's resolver. Tarball output dropped in favour of the .deb (one canonical artifact).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two things downstream consumers (Ansible roles, homelab installers,
people who don't want to
cmaketwo C++ libs by hand) keep asking for:CPack DEB configuration in
CMakeLists.txt—cpack -G DEBproduces a
.debfrom any local build.CPACK_DEBIAN_PACKAGE_SHLIBDEPS=ONmakes
dpkg-shlibdepsderiveDepends:from the binary's actuallibrary references, so the package picks up the right
libavformatN/libfftw3-double3etc. for the build host.Tag-triggered release workflow (
.github/workflows/release.yml)that runs the CPack DEB build in a per-distro container matrix and
uploads the resulting
.debplus a.sha256to the GitHub release.The workflow builds libkeyfinder as a static library and links it
into the keyfinder-cli binary so the .deb is fully self-contained — the
only runtime deps are FFmpeg + fftw3, which apt resolves from the
distro archive.
Matrix
FFmpeg ABI differs across distros, so the .deb is per-distro:
ubuntu24(FFmpeg 6 /libavformat60) — Ubuntu 24.04, Debian bookwormdebian13(FFmpeg 7 /libavformat61) — Debian trixie, Ubuntu 25.04+Both produce ~90KB packages.
Result
Consumers install with
apt install ./keyfinder-cli_*_amd64.deb. No/usr/localsurgery, noldconfig, no libkeyfinder build. Verifiedon Debian trixie:
The existing per-push
buildworkflow is untouched.Test plan
gilesw/keyfinder-cliv1.2.0-prebuilt-3),workflow ran green for both matrix entries:
https://github.com/gilesw/keyfinder-cli/releases/tag/v1.2.0-prebuilt-3
dpkg -iclean on real Debian trixie,Depends:resolved through apt,keyfinder-cli -n camelot <file>output as expected.
Notes
add_executablename iskeyfinder-cli(hyphen) which iswhat the .deb installs as. The legacy
make installproducedkeyfinder_cli(underscore). Existing beets configs may need anupdate — minor downstream impact.
-DBUILD_SHARED_LIBS=OFFon libkeyfinder's build), not baked into
CMakeLists.txt, so manualbuilds keep the original behavior.