2022-03-23 16:32:29 +00:00
|
|
|
name: Auto-update kernel
|
2022-03-23 16:08:12 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2022-03-23 16:39:42 +00:00
|
|
|
# schedule:
|
|
|
|
# # daily, hour and minute chosen arbitrarily
|
|
|
|
# - cron: "32 14 * * *"
|
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-23 16:32:29 +00:00
|
|
|
run: echo "::set-output name=sha::$(go run ./cmd/check-update/main.go)"
|
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 17:15:16 +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:52:13 +00:00
|
|
|
echo "sha ${{steps.check.outputs.sha}}"
|
2022-03-23 16:38:13 +00:00
|
|
|
cd linux-sources
|
2022-03-23 16:52:13 +00:00
|
|
|
echo "fetch"
|
2022-03-23 16:38:13 +00:00
|
|
|
git fetch --depth=1 origin ${{steps.check.outputs.sha}}
|
2022-03-23 16:52:13 +00:00
|
|
|
echo "checkout"
|
2022-03-23 16:49:09 +00:00
|
|
|
git checkout ${{steps.check.outputs.sha}}
|
2022-03-23 17:15:16 +00:00
|
|
|
echo "::set-output name=tag::$(git describe --tags)"
|
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
|
|
|
|
|
|
|
|
- name: Commit the new kernel
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
with:
|
|
|
|
commit_message: kernel ${{steps.fetch.outputs.tag}}
|