Skip to content

Enable Debian Build,Sign,Publish via GH Actions - #5

Open
endersonmaia wants to merge 48 commits into
mainfrom
feature/ci-debian-build-multiple-archs
Open

Enable Debian Build,Sign,Publish via GH Actions#5
endersonmaia wants to merge 48 commits into
mainfrom
feature/ci-debian-build-multiple-archs

Conversation

@endersonmaia

@endersonmaia endersonmaia commented Apr 22, 2026

Copy link
Copy Markdown

Add CI builds for Debian and Alpine packages across multiple architectures

This PR introduces a full CI/CD pipeline for building, signing, and publishing Cartesi Linux packages for both Debian/Ubuntu and Alpine Linux, targeting three architectures: amd64/x86_64, arm64/aarch64, and riscv64.

What's new

Packaging scripts

  • Debian (debian/): Added Makefile, Dockerfile, build scripts, and DEBBUILD specs for all packages (cartesi-machine-emulator, cartesi-machine-guest-tools, cartesi-machine-guest-linux-headers, cartesi-machine-linux-image, cartesi-machine-rootfs-image, xgenext2fs), including split install files, control, copyright, rules, and patch series.
  • Alpine (alpine/): Added Makefile, Dockerfile, and APKBUILD specs for the same set of packages, plus a re-sign helper script.

CI/CD workflows

  • .github/workflows/debian.yml: Multi-arch matrix build (ubuntu-24.04, ubuntu-24.04-arm, ubuntu-24.04-riscv) with GHA cache for Docker layers and built packages; includes build, test, sign, and publish jobs. Scoped to trigger only on changes under debian/**.
  • .github/workflows/alpine.yml: Multi-arch matrix build with analogous structure, CDN fetch before sync, and upload step. Scoped to trigger only on changes under alpine/**.
  • PACKAGES_ALLARCH (architecture-independent packages like linux-image and rootfs-image) is only built on amd64 to avoid duplicate artifacts.

Distribution targets

  • Added Debian 13 (Trixie) to the test matrix.
  • Alpine bumped to 3.23; TARGET_ARCH fixed for cross-platform Docker builds.

CDN / package repository

  • Built packages are persisted in a dedicated cdn git LFS branch (cdn/apt and cdn/apk), enabling downstream consumers to pull from cartesi.github.io/linux-packages.

Version bumps

  • cartesi-machine-emulator0.20.0
  • cartesi-machine-guest-tools and cartesi-machine-linux-image0.17.2

Documentation

  • README.md updated to list all supported distros and point to cartesi.github.io/linux-packages.
  • Added debian/README.md and alpine/README.md with per-distro usage instructions.

Comment thread debian/README.md Outdated
Comment thread debian/README.md
Comment thread debian/README.md
Comment thread debian/README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread alpine/cartesi-machine-emulator/APKBUILD Outdated
Comment thread README.md
Debian/Ubuntu packages are available in [debian](debian) subdirectory.
Alpine packages are available in [alpine](alpine) subdirectory.

You can find instructions on the sub directories.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We need to create a LICENSE and AUTHORS file.
Also mention the LICENSE.

@diegonehab
diegonehab requested a review from vfusco April 26, 2026 12:18
@endersonmaia
endersonmaia force-pushed the feature/ci-debian-build-multiple-archs branch from 2842311 to 184ae88 Compare April 27, 2026 13:21
@edubart edubart added the enhancement New feature or request label Apr 28, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Machine Unit Apr 28, 2026
Comment thread .github/workflows/debian.yml
@endersonmaia
endersonmaia force-pushed the feature/ci-debian-build-multiple-archs branch from 329e5f9 to c700e3b Compare April 29, 2026 20:39
@endersonmaia
endersonmaia force-pushed the feature/ci-debian-build-multiple-archs branch from 0c7b63d to bf6c2c7 Compare May 4, 2026 13:24
@endersonmaia
endersonmaia force-pushed the feature/ci-debian-build-multiple-archs branch from 9d8a862 to 0fec973 Compare June 30, 2026 20:21
@edubart edubart moved this from In Progress to Waiting Review in Machine Unit Aug 5, 2026
endersonmaia and others added 12 commits August 5, 2026 15:10
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mulator(-dev)

cartesi-machine-emulator 0.21.0 renamed its public C headers
(machine-c-api.h -> cm.h, jsonrpc-machine-c-api.h -> cm-jsonrpc.h), breaking
cartesi-rollups-node's cgo build, which still targets the old header names
(no released upstream tag adapts to the rename yet). Runtime Depends was
already capped to <0.21.0; Build-Depends/makedepends were not, so apt/apk
happily pulled the newest -dev package once 0.21.0 was published locally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…blish

A single package failing (e.g. cartesi-rollups-node) previously took down
the whole pipeline: `make packages` stopped at the first failing package,
none of the post-build steps had an `if:` guard so already-built packages
never got uploaded as artifacts, and every downstream job (check/test/sign/
publish) was skipped by default once the matrixed build job reported
failure for any single arch/package - even architectures where everything
built fine.

- debian.yml/alpine.yml: `make -k packages` (keep-going) plus
  `continue-on-error` on the build step so later packages still get a
  chance and already-built ones still get uploaded (`if: always()`); a
  final step re-raises the failure afterwards so the job still shows red.
- debian-check/test/sign and alpine-check/test/sign: guard with
  `!cancelled()` so they still run (and gate on actual artifact presence)
  instead of being skipped by default `needs` semantics when a build leg
  fails.
- debian.yml's cdn-restore step used `lfs: false` while cdn's
  .gitattributes marks *.deb as LFS-tracked; fixed to `lfs: true` to match
  alpine.yml and avoid resolving Build-Depends against LFS pointer files
  once real packages exist on the cdn branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Waiting Review

Development

Successfully merging this pull request may close these issues.

2 participants