This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
61 lines (60 loc) · 2.96 KB
/
kernel-release.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
name: Get the latest Kernel release for all maintained branches
on:
schedule:
- cron: '0 7 * * *'
workflow_dispatch:
jobs:
get-kernel-release:
strategy:
matrix:
branch: [main,alpha,beta,stable,lts,lts-old]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Figure out branch
id: figure-out-branch
run: .github/workflows/figure-out-branch.sh '${{ matrix.branch }}'
- name: Fetch latest Linux release
if: steps.figure-out-branch.outputs.SKIP == 0
id: fetch-latest-release
run: |
CHANNEL='${{ matrix.branch }}'
if [[ "${CHANNEL}" = 'main' ]]; then
KV=$(git ls-files 'sys-kernel/coreos-kernel/*ebuild' | head -n 1 | cut -d '-' -f 5- | cut -d . -f 1-2)
else
KV=$(curl -s -S -f -L '${{ steps.figure-out-branch.outputs.LINK }}/flatcar_production_image_packages.txt' | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2)
fi
git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux
kernelVersion=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV}\.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1)
rm -rf linux
echo "KERNEL_VERSION=${kernelVersion}" >>"${GITHUB_OUTPUT}"
- name: Set up Flatcar SDK
if: steps.figure-out-branch.outputs.SKIP == 0
id: setup-flatcar-sdk
run: .github/workflows/setup-flatcar-sdk.sh
- name: Apply patch
if: steps.figure-out-branch.outputs.SKIP == 0
id: apply-patch
env:
TARGET: ${{ steps.figure-out-branch.outputs.BRANCH }}
BASE_BRANCH: ${{ steps.figure-out-branch.outputs.BRANCH }}
PATH: ${{ steps.setup-flatcar-sdk.outputs.path }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }}
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
run: .github/workflows/kernel-apply-patch.sh
- name: Create pull request
if: (steps.figure-out-branch.outputs.SKIP == 0) && (steps.apply-patch.outputs.UPDATE_NEEDED == 1)
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: ${{ steps.figure-out-branch.outputs.BRANCH }}
branch: ${{ steps.apply-patch.outputs.BRANCH_NAME }}
author: Flatcar Buildbot <[email protected]>
committer: Flatcar Buildbot <[email protected]>
title: Upgrade Linux Kernel for ${{ steps.figure-out-branch.outputs.BRANCH }} from ${{ steps.apply-patch.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }}
body: Subject says it all.
labels: ${{ steps.figure-out-branch.outputs.LABEL }}