forked from flatcar/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (68 loc) · 3.05 KB
/
kernel-release.yaml
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
name: Get the latest Kernel release for all maintained branches
on:
schedule:
- cron: '0 7 * * *'
workflow_dispatch:
jobs:
get-kernel-release:
strategy:
matrix:
channel: [main,alpha,beta,stable,lts,lts-old]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Check out main scripts branch for GitHub workflow scripts only
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PR_TOKEN }}
path: gha
ref: main
- name: Figure out branch
id: figure-out-branch
run: gha/.github/workflows/figure-out-branch.sh '${{ matrix.channel }}'
- name: Check out work scripts branch for updating
if: steps.figure-out-branch.outputs.SKIP == 0
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PR_TOKEN }}
path: work
ref: ${{ steps.figure-out-branch.outputs.BRANCH }}
- name: Figure out latest Linux release version
if: steps.figure-out-branch.outputs.SKIP == 0
id: kernel-latest-release
env:
GHA_SCRIPTS_DIR: "${{ github.workspace }}/gha"
WORK_SCRIPTS_DIR: "${{ github.workspace }}/work"
run: gha/.github/workflows/kernel-current-major-version.sh
- name: Set up Flatcar SDK
if: steps.figure-out-branch.outputs.SKIP == 0
id: setup-flatcar-sdk
env:
WORK_SCRIPTS_DIR: "${{ github.workspace }}/work"
CHANNEL: ${{ steps.figure-out-branch.outputs.LABEL }}
# This will be empty for the main channel, but we handle
# this case inside setup-flatcar-sdk.sh.
MIRROR_LINK: ${{ steps.figure-out-branch.outputs.LINK }}
run: gha/.github/workflows/setup-flatcar-sdk.sh
- name: Apply patch
if: steps.figure-out-branch.outputs.SKIP == 0
id: apply-patch
env:
GHA_SCRIPTS_DIR: "${{ github.workspace }}/gha"
WORK_SCRIPTS_DIR: "${{ github.workspace }}/work"
VERSION_NEW: ${{ steps.kernel-latest-release.outputs.KERNEL_VERSION }}
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }}
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }}
TARGET_BRANCH: ${{ steps.figure-out-branch.outputs.BRANCH }}
run: gha/.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@v6
with:
token: ${{ secrets.BOT_PR_TOKEN }}
path: work
branch: "linux-${{ steps.kernel-latest-release.outputs.KERNEL_VERSION }}-${{ steps.figure-out-branch.outputs.BRANCH }}"
base: ${{ steps.figure-out-branch.outputs.BRANCH }}
title: Upgrade Linux Kernel for ${{ steps.figure-out-branch.outputs.BRANCH }} from ${{ steps.apply-patch.outputs.VERSION_OLD }} to ${{ steps.kernel-latest-release.outputs.KERNEL_VERSION }}
body: Subject says it all.
labels: ${{ steps.figure-out-branch.outputs.LABEL }}