Skip to content

Commit 282758d

Browse files
committed
workflows: New build-overlay-deb workflow
Pass the path to a yaml config file. Signed-off-by: Loïc Minier <[email protected]>
1 parent 69c0bd2 commit 282758d

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build a Debian package using an overlay recipe
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
config:
7+
description: 'Path to the YAML configuration file'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
arch: [amd64, arm64]
16+
runs-on: [self-hosted, qcom-u2404, "${{ matrix.arch }}"]
17+
container:
18+
image: debian:trixie
19+
options: --privileged # Required for chroot creation
20+
steps:
21+
- name: Update OS packages
22+
run: |
23+
set -ux
24+
apt update
25+
DEBIAN_FRONTEND=noninteractive apt -y upgrade
26+
DEBIAN_FRONTEND=noninteractive apt -y full-upgrade
27+
28+
- name: Install sbuild and dependencies
29+
run: |
30+
set -ux
31+
DEBIAN_FRONTEND=noninteractive \
32+
apt -y install --no-install-recommends \
33+
sudo sbuild gnupg debootstrap debian-archive-keyring schroot
34+
35+
- name: Set up sbuild user
36+
run: |
37+
set -ux
38+
useradd -m builder
39+
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
40+
mkdir -p /etc/sbuild
41+
echo 'builder' > /etc/sbuild/buildd.conf
42+
sbuild-adduser builder
43+
44+
- name: Create sbuild chroot for trixie
45+
run: |
46+
set -ux
47+
sudo sbuild-createchroot --include=eatmydata,ccache \
48+
trixie /srv/chroot/trixie-${{ matrix.runs_on }}-sbuild \
49+
http://deb.debian.org/debian
50+
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
- name: Download and build deb package
55+
run: |
56+
set -ux
57+
# install dependencies
58+
DEBIAN_FRONTEND=noninteractive \
59+
apt -y install --no-install-recommends \
60+
python3 devscripts patch python3-yaml debian-keyring
61+
# create output dir
62+
mkdir -v upload
63+
chmod a+rw upload
64+
sudo -u builder python3 scripts/build-deb.py \
65+
--config "${CONFIG_PATH}" --output-dir upload
66+
67+
- name: Upload as private artifacts
68+
uses: qualcomm-linux/upload-private-artifact-action@v1
69+
with:
70+
path: upload
71+

0 commit comments

Comments
 (0)