2022-03-23 16:32:29 +00:00
|
|
|
name: Auto-update kernel
|
2022-03-23 16:08:12 +00:00
|
|
|
|
|
|
|
on:
|
2022-03-23 19:42:47 +00:00
|
|
|
schedule:
|
|
|
|
# daily, hour and minute chosen arbitrarily
|
|
|
|
- cron: "32 14 * * *"
|
2022-03-23 19:55:05 +00:00
|
|
|
workflow_dispatch:
|
2022-03-23 16:08:12 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.18
|
|
|
|
|
|
|
|
- name: Check latest kernel version from https://archive.raspberrypi.org/debian/
|
|
|
|
id: check
|
2022-03-24 07:01:56 +00:00
|
|
|
run: |
|
|
|
|
# split lines to fail on exit != 0
|
|
|
|
sha="$(go run ./cmd/check-update/main.go)"
|
|
|
|
echo "::set-output name=sha::$sha"
|
2022-03-23 16:08:12 +00:00
|
|
|
|
|
|
|
- name: Fetch latest kernel
|
2022-03-23 16:32:29 +00:00
|
|
|
if: steps.check.outputs.sha != ''
|
2022-03-23 19:16:22 +00:00
|
|
|
id: fetch
|
2022-03-23 16:38:13 +00:00
|
|
|
run: |
|
2022-03-23 17:11:34 +00:00
|
|
|
git submodule update --init --depth=1 linux-sources
|
2022-03-23 16:38:13 +00:00
|
|
|
cd linux-sources
|
|
|
|
git fetch --depth=1 origin ${{steps.check.outputs.sha}}
|
2022-03-23 16:49:09 +00:00
|
|
|
git checkout ${{steps.check.outputs.sha}}
|
2022-03-24 07:01:56 +00:00
|
|
|
|
|
|
|
# split lines to fail on exit != 0
|
|
|
|
version="$(make kernelversion)"
|
|
|
|
echo "::set-output name=version::$version"
|
2022-03-23 16:38:13 +00:00
|
|
|
cd ..
|
|
|
|
git diff --no-ext-diff
|
2022-03-23 16:08:12 +00:00
|
|
|
|
2022-03-23 17:15:16 +00:00
|
|
|
- name: Compile latest kernel
|
|
|
|
if: steps.check.outputs.sha != ''
|
|
|
|
run: go run cmd/compile/main.go
|
|
|
|
|
2022-04-23 19:28:30 +00:00
|
|
|
- name: Show kernel config
|
|
|
|
if: steps.check.outputs.sha != ''
|
|
|
|
run: cat linux-sources/.config
|
|
|
|
|
2022-03-23 17:15:16 +00:00
|
|
|
- name: Commit the new kernel
|
2022-03-23 19:16:22 +00:00
|
|
|
if: steps.check.outputs.sha != ''
|
2022-03-23 17:15:16 +00:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
with:
|
2022-03-23 18:56:46 +00:00
|
|
|
commit_message: kernel ${{steps.fetch.outputs.version}}
|
2022-09-06 13:54:16 +00:00
|
|
|
tagging_message: v1.0.2-${{steps.fetch.outputs.version}}
|
2023-03-15 12:08:05 +00:00
|
|
|
|
|
|
|
- name: Add blank commit every 55 days to keep cron alive
|
|
|
|
uses: gautamkrishnar/keepalive-workflow@v1
|
|
|
|
with:
|
|
|
|
time_elapsed: 55
|