-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Update CI to build and publish downloadable binaries for:
Linux
linux/386(x86)linux/amd64(x86_64)linux/arm64(aarch64)
macOS
darwin/amd64(x86_64)darwin/arm64(Apple Silicon)
Build system requirement: use Docker Buildx for the builds (multi-arch), producing archives as CI artifacts and attaching them to GitHub Releases on tags.
Motivation
- Standardize builds across platforms using a reproducible container pipeline
- Make multi-arch outputs deterministic (toolchains pinned in Dockerfiles)
- Simplify local reproduction: “build the same thing CI builds”
Scope
Expected artifacts
For each target produce:
- packaged binary archive (
.tar.gzfor Linux,.zipor.tar.gzfor macOS) - checksums (
.sha256orSHA256SUMS) - optional:
SBOM/provenance later (not required initially)
Suggested naming:
projectname-<version>-linux-386.tar.gzprojectname-<version>-linux-amd64.tar.gzprojectname-<version>-linux-arm64.tar.gzprojectname-<version>-macos-amd64.tar.gzprojectname-<version>-macos-arm64.tar.gz
Implementation approach (Docker Buildx)
Strategy
Use Buildx multi-platform to build dedicated “builder” images that:
- compile the project for the target triple/arch
- export build outputs (binary + metadata) to the CI workspace
We will implement one Dockerfile (or a small set) supporting:
- Linux targets: build inside a multi-arch container (native under QEMU where needed)
- macOS targets: build via osxcross toolchain inside Linux containers (cross-compiling
darwin/amd64anddarwin/arm64)
Note: macOS binaries cannot be natively built in Docker without Apple runners, but cross-compilation via osxcross is feasible for many C/C++ projects.
CI (GitHub Actions) high level
- Setup QEMU + Buildx
- Use
docker buildx buildwith:--platform linux/386,linux/amd64,linux/arm64- produce artifacts via
--output type=local,dest=dist/ortype=tar
- For macOS, run separate build targets (still with buildx) that use osxcross:
--build-arg TARGET=darwin-amd64--build-arg TARGET=darwin-arm64--output type=local,dest=dist/
Dockerfile outline
- Multi-stage build:
base: deps (compiler, cmake/ninja, etc.)build-linux: compile for current container archbuild-macos: compile with osxcross for selected Darwin targetpackage: copy binary + license/readme + generate checksums + archive
Release publishing
- On push tags (
v*):- upload archives to GitHub Release assets
- On PR / main:
- upload as workflow artifacts only
Validation
- For Linux artifacts, run smoke test in container (
./bin --help/--version) for each arch where feasible (native amd64; others possibly under QEMU) - For macOS artifacts:
- validate file format (
filereports Mach-O) - optionally validate version string via
strings(best-effort)
- validate file format (
Acceptance criteria
- CI produces 5 artifacts: Linux
386, Linuxamd64, Linuxarm64, macOSamd64, macOSarm64 - Build is performed via Docker Buildx
- Artifacts include checksums
- Artifacts are uploaded on every workflow run
- Tag builds attach artifacts to GitHub Releases
Tasks
- Add Docker Buildx setup in CI (QEMU + builder)
- Create Dockerfile(s) for Linux multi-arch build with Buildx
- Add osxcross-based stages for macOS
amd64+arm64 - Implement packaging + consistent naming
- Upload workflow artifacts + release assets on tag
- Add smoke checks / format checks per target
Notes / Risks
linux/386may require extra care depending on dependencies (some libs drop 32-bit support).- macOS cross-compilation depends on osxcross availability and requires an Apple SDK; ensure licensing-compliant acquisition method (documented in repo, not vendored).
- Some dependencies may not build cleanly under QEMU; prefer deterministic toolchains and caching.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request