Skip to content

Build deb, rpm and Arch packages in CI and attach them to releases - #124

Merged
chrisuthe merged 3 commits into
mainfrom
chrisuthe/task/build-deb-rpm-and-arch-packages-in-ci-and-attach
Nov 19, 2026
Merged

chrisuthe merged 3 commits into
mainfrom
chrisuthe/task/build-deb-rpm-and-arch-packages-in-ci-and-attach

Conversation

@chrisuthe

Copy link
Copy Markdown
Member

Build native Linux packages (.deb, .rpm, Arch .pkg.tar.zst) in CI for every published Linux leg and attach them to releases next to the tarballs.

What

  • packaging/nfpm.yaml and maintainer scripts. scripts/build_linux_packages.sh downloads nfpm 2.48.0 (version and sha256 pinned, per host arch), fills the placeholders and builds each format.
  • The packages carry each leg's already-tested binary. The build tree is reconfigured to CMAKE_INSTALL_PREFIX=/usr (no recompile), staged with DESTDIR, then reconfigured back to /usr/local. A cmp against the tarball's binary proves the packages ship the same file.
  • Legs: x86_64, arm64 and armv7 get deb, rpm and Arch. armv6 gets deb (armhf, for Raspberry Pi OS) and Arch armv6h, with no rpm.
  • Asset names follow the tarballs: sendspin-cli-<version>-<leg>.{deb,rpm,pkg.tar.zst}. This keeps the armv6 and armv7 debs apart even though both are armhf.
  • scripts/assert_linux_packages.sh checks each package's exact file list and modes, name, version, architecture and dependencies. It reads the glibc floor off the packaged binary and checks that all formats carry the same binary.
  • scripts/test_linux_packages.sh runs on x86_64 and arm64. It installs, runs and removes the packages on clean debian:trixie, ubuntu:24.04 and fedora:latest, plus archlinux:latest on x86_64. It checks --version, the sendspin-cli account and audio group, the unit's /usr/bin ExecStart, that the unit is not enabled, and that removal leaves no files. It also checks that debian:bookworm refuses the deb on libc6 (>= 2.38).
  • Postinstall runs systemd-sysusers sendspin-cli.conf and calls daemon-reload only when systemd is booted. It never enables or starts the service. Preremove disables and stops the unit on removal but not on upgrade, and leaves the account and /var/lib/sendspin-cli.
  • release.yml: both expected-asset lists, SHA256SUMS and the upload glob include the packages.
  • Docs: an Installation → Packages section covering supported releases per leg, verify-and-install for each format, and the /usr vs /usr/local split. README and contributors.md point to it.

Out of scope: signed apt/dnf repositories (follow-up, needs a signing key), snap, flatpak.

Compatibility

Nothing breaks for existing CLI users. The tarballs keep the same payload and the same /usr/local layout, and the existing payload assertions are unchanged. get_started_linux.sh and the uninstaller are untouched, and no flags, config keys, socket protocol or state format changed. The release gains new assets. Packages install to /usr, and the docs say not to mix them with a /usr/local tarball install on the same machine.

Testing

Run locally against an Ubuntu 24.04 build:

  • Package build and assert for all four legs' arch and dependency mappings.
  • Install, run and remove on trixie, noble, Fedora and Arch, plus the bookworm refusal.
  • shellcheck.

Not tested locally:

  • The workflows themselves.
  • The armv7 and armv6 packages, which CI asserts but does not install.

Packages reuse each leg's tested binary, restaged at /usr with a pinned nfpm.
Each is asserted for files, architecture and dependencies, and the x86_64 and
arm64 ones are installed and removed on clean Debian, Ubuntu, Fedora and Arch.
A bare '-' for the skipped rpm arch is not valid YAML.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The removal script skips disabling the unit when systemd is not booted, leaving enablement symlinks that can cause the service to start again after a later reinstall.

1 open issue
What changed in this PR

Adds native Linux packages alongside existing release archives, using the same tested binaries while preserving the tarballs’ /usr/local layout.

Changes:

  • Builds .deb, .rpm, and Arch packages for Linux release architectures, excluding RPM on ARMv6.
  • Adds package-content checks, container installation tests, and release asset verification.
  • Documents package installation, compatibility, and service lifecycle behavior.
File Description
scripts/​test_linux_packages.sh Tests installation, execution, removal, and incompatible glibc rejection.
scripts/​build_linux_packages.sh Builds packages with pinned nfpm and architecture mappings.
scripts/​assert_linux_packages.sh Checks package contents, metadata, dependencies, and binary identity.
README.md Introduces Linux packages and links installation guidance.
packaging/​preremove.sh Stops and disables the service on removal, not upgrade.
packaging/​postremove.sh Reloads systemd after package removal.
packaging/​postinstall.sh Creates the service account without enabling or starting the service.
packaging/​nfpm.yaml Defines package payloads, dependencies, and lifecycle hooks.
docs/​wiki/​Installation.md Documents compatibility, verification, installation, and upgrades.
contributors.md Updates packaging and release process guidance.
.github/​workflows/​release.yml Verifies, checksums, and publishes Linux package assets.
.github/​workflows/​ci.yml Extends shell linting to package maintainer scripts.
.github/​workflows/​build.yml Stages, builds, validates, tests, and uploads Linux packages.
.github/​workflows/​build-armv6.yml Builds, validates, and uploads ARMv6 Debian and Arch packages.

Review effort: Balanced (adaptive)

Comment thread packaging/preremove.sh Resolved
Enablement symlinks are not package-owned, so a chroot removal left them behind.
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