-
-
Notifications
You must be signed in to change notification settings - Fork 200
56 lines (50 loc) · 1.96 KB
/
Copy pathupdate-kernel-configs.yml
File metadata and controls
56 lines (50 loc) · 1.96 KB
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
name: Update kernel config
on:
schedule:
- cron: '17 */12 * * *' # “At minute 17 past every 12th hour.”
workflow_dispatch:
jobs:
update-kernel-config:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- link: https://gitlab.archlinux.org/archlinux/packaging/packages/linux
filename: config.x86_64
tag_suffix: .arch
- link: https://gitlab.archlinux.org/archlinux/packaging/packages/linux-lts
filename: config
tag_suffix: '-'
steps:
- name: Get latest config file version upstream
id: upstream-config
run: |
set -o pipefail
git -c 'versionsort.suffix=${{ matrix.tag_suffix }}' \
ls-remote --exit-code --refs --sort='version:refname' --tags ${{ matrix.link }}.git '*.*' \
| cut --delimiter='/' --fields=3 | tail -n 1 > latest-upstream-config
echo "latest=$(cat latest-upstream-config)" >> $GITHUB_OUTPUT
echo "kver=$(cat latest-upstream-config | cut -d. -f 1,2 )" >> $GITHUB_OUTPUT
- name: Checkout linux-tkg
uses: actions/checkout@v4
- name: Update config file
id: update-config
run: |
cd linux-tkg-config/${{ steps.upstream-config.outputs.kver }}
wget ${{ matrix.link }}/-/raw/main/${{ matrix.filename }} -O config.x86_64
if git diff --exit-code config.x86_64
then
echo "config-updated=0" >> $GITHUB_OUTPUT
else
echo "config-updated=1" >> $GITHUB_OUTPUT
fi
- name: Push changes
if: steps.update-config.outputs.config-updated == '1'
run: |
git config --global user.name 'Frogminer'
git config --global user.email 'frogminer@miner.frog'
git pull
git commit -am "Update ${{ steps.upstream-config.outputs.kver }} kernel config to ${{ steps.upstream-config.outputs.latest }}"
git push