kernel-rpi-os-32/.github/workflows/cron.yml

46 lines
1.3 KiB
YAML
Raw Normal View History

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-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 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-23 19:16:22 +00:00
echo "::set-output name=version::$(make kernelversion)"
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
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-03-23 19:16:22 +00:00
tagging_message: v1.0.0-${{steps.fetch.outputs.version}}