Skip to content

Add cargo-dist release pipeline with deb, rpm and apk packaging - #2

Open
baol wants to merge 1 commit into
mainfrom
dist-release-pipeline
Open

baol wants to merge 1 commit into
mainfrom
dist-release-pipeline

Conversation

@baol

@baol baol commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Pushing a v* tag builds and publishes a GitHub Release via cargo-dist (dist-workspace.toml, generated .github/workflows/release.yml).

Artifacts per release

Artifact Contents
mapshoot-{x86_64,aarch64}-unknown-linux-musl.tar.xz fully static musl binary, README, both licenses, OFL.txt
mapshoot-{x86_64,aarch64}-apple-darwin.tar.xz macOS binaries
mapshoot-amd64.deb / mapshoot-arm64.deb, .rpm, .apk native packages built from the static binaries
mapshoot-installer.sh curl | sh installer
sha256.sum, mapshoot-packages.sha256, mapshoot.cdx.xml checksums and a CycloneDX SBOM
GitHub attestations SLSA build provenance

Design notes

  • Linux is musl-only. mapshoot's only native dependency is ring; trust roots are bundled through webpki-roots and the marker font is compiled in, so a static musl binary has no runtime dependencies and runs on glibc distributions and Alpine alike. One artifact per architecture replaces a glibc-version matrix, and there are no -gnu builds.
  • cargo-dist has no deb/rpm/apk support, so packaging/build-packages.sh runs as an extra-artifacts build step in the global build phase, where dist has already staged the local artifacts into target/distrib/. It fetches a pinned, sha256-verified nfpm 2.48.0 and drives packaging/nfpm.yaml.
  • Both Linux targets build natively on ubuntu-22.04 and ubuntu-22.04-arm; no cross-compilation is involved.
  • Packages declare no dependencies, carry a man page, and install the license files including the marker font's OFL.txt (required by OFL 1.1).
  • [profile.dist] inherits release, so release artifacts keep the existing lto / strip / codegen-units settings.

Verification

Built a real x86_64 musl artifact with dist build and ran the packaging pipeline against it:

  • dist plan lists all four archives, six packages, the checksums, SBOM and installer; dist generate is idempotent.
  • The tarball holds the binary plus README, LICENSE-MIT, LICENSE-APACHE and OFL.txt.
  • deb — no Depends field; contents are exactly /usr/bin/mapshoot, man1/mapshoot.1, README, copyright and the licenses; it extracts, the binary runs (mapshoot 0.1.0), and the man page renders.
  • rpm — installs and runs on rockylinux:9; Requires are only the standard rpmlib(...) markers.
  • apk — apk add --allow-untrusted installs and runs on alpine:3.22; dependency list is empty.

Known caveats

  • The .apk and the macOS binaries are unsigned. macOS downloads will be quarantined until Developer ID signing and notarization are added; the .apk needs --allow-untrusted.
  • Only the x86_64 musl path was exercised locally; aarch64 and macOS rely on the native runners cargo-dist selects.
  • docs/mapshoot.1 and the CLI's embedded HELP string describe the same flags by hand and can drift.

First release is git tag v0.1.0 && git push origin v0.1.0.

Pushing a v* tag now builds and publishes a GitHub Release carrying:

- fully static musl tarballs for x86_64 and aarch64, each holding the
  binary, README, both license files and the embedded font's license;
- macOS tarballs for Intel and Apple Silicon;
- a curl | sh installer;
- native .deb, .rpm and .apk packages built from the static binaries;
- sha256.sum and mapshoot-packages.sha256 checksums, a CycloneDX SBOM and
  SLSA build provenance attestations.

cargo-dist has no built-in deb/rpm/apk support, so packaging/build-packages.sh
runs as an extra-artifacts step in the global build phase, where the local
artifacts are already staged in target/distrib/. It fetches a pinned,
checksum-verified nfpm and drives packaging/nfpm.yaml for both architectures.

The Linux binaries are statically linked against musl, so one artifact per
architecture runs on glibc distributions and Alpine alike. The packages
therefore declare no runtime dependencies and there are no -gnu builds.

Also adds a man page (docs/mapshoot.1) installed by all three package formats,
a Debian machine-readable copyright covering the dual license and the marker
font's OFL-1.1, and repository/homepage metadata.
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