Skip to content

Commit 7c88fab

Browse files
committed
github: add build workflow
1 parent de9ad97 commit 7c88fab

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# based on https://github.com/zabbly/linux/blob/x86_64/.github/workflows/builds.yml
2+
name: Builds
3+
on:
4+
- push
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build-kernel:
11+
name: Build kernel
12+
strategy:
13+
fail-fast: false
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Install dependencies
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install --yes \
23+
build-essential \
24+
bc \
25+
binutils \
26+
bison \
27+
cpio \
28+
debhelper \
29+
dpkg-dev \
30+
flex \
31+
git \
32+
kmod \
33+
libelf-dev \
34+
libssl-dev \
35+
rsync \
36+
zstd
37+
38+
sudo apt-get install --yes pahole || true
39+
40+
- name: Configure git
41+
run: |
42+
git config user.email "noreply@kernoops.org"
43+
git config user.name "Custom kernel build"
44+
45+
- name: Generate version string
46+
env:
47+
PKGARCH: "amd64"
48+
PKGOS: "ubuntu-24.04"
49+
run: |
50+
VERSION="$(make kernelversion)-${PKGARCH}-$(date -u +%Y%m%d%H%M)-$(echo ${PKGOS} | sed "s/-//g")"
51+
echo "${VERSION}"
52+
echo "${VERSION}" > ../.version
53+
54+
- name: Build the kernel
55+
env:
56+
DEBEMAIL: "noreply@kernoops.org"
57+
DEBFULLNAME: "Custom Kernel Builds"
58+
KDEB_CHANGELOG_DIST: "ubuntu-24.04"
59+
KDEB_COMPRESS: "zstd"
60+
PKGOS: "ubuntu-24.04"
61+
run: |
62+
export KDEB_PKGVERSION="$(cat ../.version)"
63+
export KDEB_SOURCENAME="linux-kernoops-${KDEB_PKGVERSION}"
64+
65+
make oldconfig
66+
make deb-pkg -j$(nproc) || make deb-pkg -j$(nproc)
67+
68+
- name: Prepare the artifacts
69+
run: |
70+
mkdir out/
71+
mv ../linux-* out/
72+
73+
- name: Upload resulting build
74+
uses: actions/upload-artifact@v4
75+
continue-on-error: true
76+
with:
77+
name: linux-kernel-build
78+
path: out/*
79+
if-no-files-found: error
80+
retention-days: 90

0 commit comments

Comments
 (0)