Skip to content

Commit f28fb5a

Browse files
authored
ci: add procedure to detect kernel update (#21)
1 parent 432191e commit f28fb5a

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
lines changed
Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,25 @@ scms:
66
github:
77
kind: github
88
spec:
9-
branch: '{{ .scm.branch }}'
10-
email: '{{ .scm.email }}'
11-
owner: '{{ .scm.owner }}'
12-
repository: '{{ .scm.repository }}'
9+
branch: {{ .github.branch }}
10+
email: {{ .github.email }}
11+
owner: {{ .github.owner }}
12+
repository: {{ .github.repository }}
1313
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
14-
user: '{{ .scm.user }}'
15-
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
14+
user: {{ .github.user }}
15+
username: {{ .github.username }}
16+
17+
actions:
18+
pr:
19+
kind: github/pullrequest
20+
scmid: github
21+
spec:
22+
title: "Update Kernel Version"
23+
# automerge: true
24+
draft: false
25+
labels:
26+
- "dependencies"
27+
- "kernel"
1628

1729
sources:
1830
kernelVersion:
@@ -25,9 +37,8 @@ sources:
2537
targets:
2638
bumpKernelVersion:
2739
name: Update pipeline to the latest Kernel version
28-
kind: yaml
40+
kind: file
2941
scmid: github
3042
spec:
31-
file: .github/workflows/build.yaml
32-
key: $.jobs.build.env.KVERSION
33-
value: '{{ source "kernelVersion" }}'
43+
file: kernel
44+
content: '{{ source "kernelVersion" }}'

.github/updatecli.d/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
github:
2+
user: "mavimo"
3+
4+
username: "mavimo"
5+
branch: "main"
6+
owner: "mavimo"
7+
repository: "apple-container-kernel"

.github/workflows/build.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ concurrency:
1818
jobs:
1919
build:
2020
env:
21-
KVERSION: 6.17.6
2221
KIMAGE: kernel-build:0.1
2322

2423
runs-on: ubuntu-24.04-arm
@@ -29,6 +28,12 @@ jobs:
2928
with:
3029
submodules: recursive
3130

31+
- name: Read kernel version
32+
id: read_kernel
33+
run: |
34+
KVERSION=$(cat kernel)
35+
echo "kernel_version=${KVERSION}" >> "$GITHUB_OUTPUT"
36+
3237
- name: Set up QEMU
3338
uses: docker/setup-qemu-action@v3
3439

@@ -48,7 +53,7 @@ jobs:
4853
- name: Download kernel sources
4954
run: |
5055
cd apple-containerization/kernel/
51-
curl -SsL -o source.tar.xz https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${KVERSION}.tar.xz
56+
curl -SsL -o source.tar.xz https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${{ steps.read_kernel.outputs.kernel_version }}.tar.xz
5257
5358
- name: Run kernel build
5459
run: |
@@ -75,5 +80,5 @@ jobs:
7580
## :package: Kernel Build Complete :package:
7681
The kernel has been successfully built! You can download the kernel image from the [Artifacts](../actions) section of this pull request.
7782
78-
**Kernel Version:** `${{ env.KVERSION }}`
83+
**Kernel Version:** `${{ steps.read_kernel.outputs.kernel_version }}`
7984
**Build Status:** ✅ Successful

.github/workflows/dependency-update.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
uses: updatecli/[email protected]
2323

2424
- name: Update Kernel Version
25-
run: updatecli apply --config .github/.updatecli.d/update-kernel.yaml
25+
run: updatecli apply --config .github/updatecli.d/update-kernel.yaml --values .github/updatecli.d/values.yaml
2626
env:
27-
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

kernel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.14.1

0 commit comments

Comments
 (0)