-
Notifications
You must be signed in to change notification settings - Fork 4
158 lines (139 loc) · 4.8 KB
/
kernelsu.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: KernelSU Development Build (Galaxy M30S)
on:
push:
jobs:
notify:
name: Build Notification
runs-on: ubuntu-latest
steps:
- name: Send build message to Telegram
uses: appleboy/telegram-action@master
env:
TELEGRAM_TO: "${{ secrets.TELEGRAM_TO }}"
TELEGRAM_TOKEN: "${{ secrets.TELEGRAM_TOKEN }}"
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: "🛠️ Build Started for KernelSU 👷"
failure-notification:
name: Failure Notification
needs: [build-kernelsu]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Send failure message to Telegram
uses: appleboy/telegram-action@master
env:
TELEGRAM_TO: "${{ secrets.TELEGRAM_TO }}"
TELEGRAM_TOKEN: "${{ secrets.TELEGRAM_TOKEN }}"
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: "🛑 Build failed for KernelSU 😞"
build-kernelsu:
name: Build KernelSU
runs-on: ubuntu-latest
strategy:
matrix:
variant: [oneui, aosp]
enforcing: [e, p]
android: [11,12]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: szenius/[email protected]
with:
timezone: "Asia/Kolkata"
- name: Export build branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: branch_name
- name: Update Debian/Ubuntu Repositories
run: sudo apt-get update
- name: Install Debian/Ubuntu dependencies
run: sudo apt-get install bzip2 lib32stdc++6 libc6-dev-i386 libncurses5 jq -y
- name: Setup KernelSU
run: |
set -eo pipefail
echo " I: Building Mint kernel ${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER}"
cd KernelSU
echo "KSU_VERSION=$(($(git rev-list --count HEAD) + 10200))" >> $GITHUB_ENV
cd -
- name: Build Mint kernel
id: build-kernel
run: |
set -eo pipefail
echo " I: Building Mint kernel ${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER}"
if [[ "${{ matrix.enforcing }}" == "e" ]]; then
./build.sh --kernelsu --automated --device m30s --variant ${{ matrix.variant }} --android ${{ matrix.android }}
elif [[ "${{ matrix.enforcing }}" == "p" ]]; then
./build.sh --kernelsu --automated --device m30s --variant ${{ matrix.variant }} --android ${{ matrix.android }} --permissive
fi
- name: Prepare release package
run: |
mkdir -p ./release
mv -f `find ./ -iname *.zip` ./release/
- name: Prepare build config artifact
run: |
cp .config ./release/kernel_config_a50_${{ matrix.variant }}-s-k-${{ matrix.enforcing }}.txt
- name: Upload build to Telegram
uses: appleboy/telegram-action@master
env:
TELEGRAM_TO: "${{ secrets.TELEGRAM_TO }}"
TELEGRAM_TOKEN: "${{ secrets.TELEGRAM_TOKEN }}"
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: " "
document: ./release/*.zip
ksumanager:
name: Download ksu latest manager
needs: [build-kernelsu]
runs-on: ubuntu-latest
steps:
- name: Download ksu latest manager
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build-manager.yml
workflow_conclusion: completed
branch: main
event: push
name: manager
name_is_regexp: true
path: ./tmp/
repo: tiann/KernelSU
check_artifacts: false
search_artifacts: false
skip_unpack: false
if_no_artifact_found: fail
- name: Upload Manager to Telegram
uses: appleboy/telegram-action@master
env:
TELEGRAM_TO: "${{ secrets.TELEGRAM_TO }}"
TELEGRAM_TOKEN: "${{ secrets.TELEGRAM_TOKEN }}"
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: "Manager"
document: ./tmp/manager/*.apk
if-no-files-found: error
del_runs:
name: Delete workflow runs
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository: ${{ github.repository }}
retain_days: 1
keep_minimum_runs: 1
delete_workflow_pattern: all
delete_workflow_by_state_pattern: all
delete_run_by_conclusion_pattern: all