Skip to content

Initial version of overlay to build Debian packages #5

Initial version of overlay to build Debian packages

Initial version of overlay to build Debian packages #5

name: Build a Debian package using an overlay recipe
on:
# temporarily allow on push and pull_request
push:
pull_request:
workflow_dispatch:
inputs:
config:
description: 'Path to the YAML configuration file'
required: true
type: string
# this provides a fallback on pull_request where we can't set the value
env:
CONFIG_PATH: ${{ inputs.config || 'overlay-debs/sample-hello-unmodified/hello_2.10-5.yaml' }}
jobs:
build:
strategy:
matrix:
arch: [amd64, arm64]
runs-on: [self-hosted, qcom-u2404, "${{ matrix.arch }}"]
container:
image: debian:trixie
options: --privileged # Required for chroot creation
steps:
- name: Update OS packages
run: |
set -ux
apt update
DEBIAN_FRONTEND=noninteractive apt -y upgrade
DEBIAN_FRONTEND=noninteractive apt -y full-upgrade
- name: Install sbuild and dependencies
run: |
set -ux
DEBIAN_FRONTEND=noninteractive \
apt -y install --no-install-recommends \
sudo sbuild gnupg debootstrap debian-archive-keyring schroot
- name: Set up sbuild user
run: |
set -ux
useradd -m builder
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
mkdir -p /etc/sbuild
echo 'builder' > /etc/sbuild/buildd.conf
sbuild-adduser builder
- name: Create sbuild chroot for trixie
run: |
set -ux
sudo sbuild-createchroot --include=eatmydata,ccache \
trixie /srv/chroot/trixie-${{ matrix.runs_on }}-sbuild \
http://deb.debian.org/debian
- name: Checkout repository
uses: actions/checkout@v4
- name: Download and build deb package
run: |
set -ux
# install dependencies
DEBIAN_FRONTEND=noninteractive \
apt -y install --no-install-recommends \
python3 devscripts patch python3-yaml debian-keyring
# create output dir
mkdir -v upload
chmod a+rw upload
sudo -u builder python3 scripts/build-deb.py \
--config "${CONFIG_PATH}" --output-dir upload
- name: Upload as private artifacts
uses: qualcomm-linux/upload-private-artifact-action@v1
with:
path: upload