Skip to content

Commit dc469f5

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

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

.github/workflows/build.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 "[email protected]"
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: Prepare for the build
55+
run: |
56+
mv .config .config.new
57+
git commit -m "TEMP: Remove config from index" .config
58+
mv .config.new .config
59+
60+
- name: Build the kernel
61+
env:
62+
DEBEMAIL: "[email protected]"
63+
DEBFULLNAME: "Custom Kernel Builds"
64+
KDEB_CHANGELOG_DIST: "ubuntu-24.04"
65+
KDEB_COMPRESS: "zstd"
66+
PKGOS: "ubuntu-24.04"
67+
run: |
68+
export KDEB_PKGVERSION="$(cat ../.version)"
69+
export KDEB_SOURCENAME="linux-kernoops-${KDEB_PKGVERSION}"
70+
71+
make oldconfig
72+
make deb-pkg -j$(nproc) || make deb-pkg -j$(nproc)
73+
74+
- name: Prepare the artifacts
75+
run: |
76+
mkdir out/
77+
mv ../linux-* out/
78+
79+
- name: Upload resulting build
80+
uses: actions/upload-artifact@v4
81+
continue-on-error: true
82+
with:
83+
name: linux-kernel-build
84+
path: out/*
85+
if-no-files-found: error
86+
retention-days: 90

0 commit comments

Comments
 (0)