Skip to content

Commit

Permalink
.github/workflows: Rework workflow, add KernelSU tag check CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Sep 17, 2023
1 parent 55ffc15 commit 1464a79
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test buildable kernel
name: Test build kernel

on:
push:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/update_ksu_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check KernelSU tag update

on:
schedule:
- cron: '0 12 15,30 * *'
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/[email protected]
with:
fetch-depth: 1

- name: Check update
run: |
bash scripts/check-kernelsu-update.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ kernel/configs/android-*.cfg
#
Android.bp
local.config
!.github/
18 changes: 18 additions & 0 deletions scripts/check-kernelsu-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git submodule update --init
pushd KernelSU
LOCAL_LATEST=$(git describe --tags)
git pull origin main
REMOTE_LATEST=$(git describe --tags)
if [ $LOCAL_LATEST = $REMOTE_LATEST ]; then
echo "No changes: Local tag $LOCAL_LATEST is latest"
exit 0;
fi
git checkout $REMOTE_LATEST
popd
git add KernelSU
git commit -m "KernelSU: Update release tag to $REMOTE_LATEST" -m "Update the tag from $LOCAL_LATEST to $REMOTE_LATEST"
git push

0 comments on commit 1464a79

Please sign in to comment.