-
-
Notifications
You must be signed in to change notification settings - Fork 175
89 lines (71 loc) · 2.71 KB
/
build-release-kernels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Build & Release Latest Kernel
on:
schedule:
- cron: '17 */12 * * *' # “At minute 17 past every 12th hour.”
workflow_dispatch:
jobs:
kver-checks:
runs-on: ubuntu-latest
outputs:
latest_release: ${{ steps.latest_release.outputs.release }}
latest_kernel: ${{ steps.versions.outputs.latest_kernel }}
steps:
# Get latest release in repo, so we compare its version
# with the latest kernel available so far
- name: Get latest release
id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
# it fails when there's no release
continue-on-error: true
- name: Checkout linux-tkg
uses: actions/checkout@v4
- name: Get latest kernel version
id: versions
run: |
get_latest_kernel() {
git -c 'versionsort.suffix=-' \
ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/gregkh/linux.git '*.*' \
| cut --delimiter='/' --fields=3 | grep "$1" | tail -n 1
}
grep "_current_kernels=(" linux-tkg-config/prepare > current_kernels.txt
source current_kernels.txt
latest_kernel=`get_latest_kernel "${_current_kernels[0]}"`
if [[ "$latest_kernel" =~ "rc" ]]
then
latest_kernel=`get_latest_kernel "${_current_kernels[1]}"`
fi
echo "latest_kernel=$latest_kernel" >> $GITHUB_OUTPUT
build:
strategy:
fail-fast: false
matrix:
_cpusched: [bore, eevdf]
os: [arch, ubuntu, fedora]
uses: ./.github/workflows/builder-dispatcher.yml
with:
_cpusched: ${{ matrix._cpusched }}
os: ${{ matrix.os }}
needs: [kver-checks]
if: needs.kver-checks.outputs.latest_kernel != needs.kver-checks.outputs.latest_release
make-release:
runs-on: ubuntu-latest
needs:
- kver-checks
- build
if: needs.build.result == 'success'
steps:
- name: Checkout linux-tkg
uses: actions/checkout@v4
- name: Download release artifacts
uses: actions/download-artifact@v4
- name: Make new release
env:
GH_TOKEN: ${{ github.token }}
run: |
files_list=$(find *-kernel-packages-* -type f | paste -sd' ')
gh release create ${{ needs.kver-checks.outputs.latest_kernel }} $files_list --latest \
--title 'diet linux-tkg ${{ needs.kver-checks.outputs.latest_kernel }}' \
--notes 'This is a version of linux-tkg built with the option `_kernel_on_diet` enabled.
If you encounter issues with it, please build the kernel locally with that option disabled.'