Skip to content

Commit c6b393d

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 2e74c25 commit c6b393d

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
include:
16+
- arch: amd64
17+
runs-on: [self-hosted, qcom-u2404, amd64]
18+
- arch: arm64
19+
runs_on: [self-hosted, qcom-u2404, arm64]
20+
runs-on: ${{ matrix.runs_on }}
21+
container:
22+
image: debian:trixie
23+
options: --privileged # Required for chroot creation
24+
steps:
25+
- name: Update OS packages
26+
run: |
27+
set -ux
28+
apt update
29+
DEBIAN_FRONTEND=noninteractive apt -y upgrade
30+
DEBIAN_FRONTEND=noninteractive apt -y full-upgrade
31+
32+
- name: Install sbuild and dependencies
33+
run: |
34+
set -ux
35+
DEBIAN_FRONTEND=noninteractive \
36+
apt -y install --no-install-recommends \
37+
sudo sbuild gnupg debootstrap debian-archive-keyring schroot
38+
39+
- name: Set up sbuild user
40+
run: |
41+
set -ux
42+
useradd -m builder
43+
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
44+
mkdir -p /etc/sbuild
45+
echo 'builder' > /etc/sbuild/buildd.conf
46+
sbuild-adduser builder
47+
48+
- name: Create sbuild chroot for trixie
49+
run: |
50+
set -ux
51+
sudo sbuild-createchroot --include=eatmydata,ccache \
52+
trixie /srv/chroot/trixie-${{ matrix.runs_on }}-sbuild \
53+
http://deb.debian.org/debian
54+
55+
- name: Checkout repository
56+
uses: actions/checkout@v4
57+
58+
- name: Download and build deb package
59+
run: |
60+
set -ux
61+
# install dependencies
62+
DEBIAN_FRONTEND=noninteractive \
63+
apt -y install --no-install-recommends \
64+
python3 devscripts patch python3-yaml debian-keyring
65+
sudo -u builder python3 scripts/build-deb.py \
66+
--config "${{ inputs.config }}"
67+
68+
- name: Stage results for upload
69+
run: |
70+
set -ux
71+
mkdir -v upload
72+
cp $(dcmd *.changes) upload
73+
74+
- name: Upload as private artifacts
75+
uses: qualcomm-linux/upload-private-artifact-action@v1
76+
with:
77+
path: upload
78+

0 commit comments

Comments
 (0)