48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Auto-update kernel
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# schedule:
|
|
# # daily, hour and minute chosen arbitrarily
|
|
# - cron: "32 14 * * *"
|
|
|
|
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
|
|
run: echo "::set-output name=sha::$(go run ./cmd/check-update/main.go)"
|
|
|
|
- name: Fetch latest kernel
|
|
if: steps.check.outputs.sha != ''
|
|
id: fetch
|
|
run: |
|
|
git submodule update --init --depth=1 linux-sources
|
|
echo "sha ${{steps.check.outputs.sha}}"
|
|
cd linux-sources
|
|
echo "fetch"
|
|
git fetch --depth=1 origin ${{steps.check.outputs.sha}}
|
|
echo "checkout"
|
|
git checkout ${{steps.check.outputs.sha}}
|
|
echo "::set-output name=tag::$(git describe --tags)"
|
|
cd ..
|
|
git diff --no-ext-diff
|
|
|
|
- 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}}
|