forked from Sakurajima07/kernel_builder
-
Notifications
You must be signed in to change notification settings - Fork 2
174 lines (168 loc) · 6.44 KB
/
Copy pathinfinity.yml
File metadata and controls
174 lines (168 loc) · 6.44 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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Building infinity branch
on: # [push]
# release:
# types: [published]
# push:
# branches:
# - master
# paths:
# - '.config'
# schedule:
# - cron: 0 8 * * 5
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
COMPILER:
description: 'compilers used'
required: true
default: 'AOSP-Clang-11'
KREPO:
description: 'kernel repo'
required: true
default: 'https://github.com/MrGadget84/white_kernel_samsung_mt6768'
KBRANCH:
description: 'kernel branch'
required: true
default: 'infinity'
NOTES:
description: 'notes to print out'
required: false
default: ''
SUFFIX:
description: 'suffix to aplly to teh zip filename'
required: false
default: ''
ZREPO:
description: 'zipper repo'
required: true
default: 'https://github.com/MrGadget84/AnyKernel3_samsung'
ZBRANCH:
description: 'zipper branch'
required: true
default: 'a325f'
KSU:
description: 'if dont want ksu then leave blank'
required: false
default: 'ksu'
TG_RECIPENT:
description: 'group id'
required: true
default: '-1003050733874'
CONTAINER:
description: 'if you know you know'
required: true
default: 'fedora:40'
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
REPO: ${{ github.event.inputs.KREPO }}
RUN_NUM: ${{ github.run_number }}_${{ github.run_attempt }}
KERNEL_BRANCH: ${{ github.event.inputs.KBRANCH }}
NOTE: ${{ github.event.inputs.NOTES }}
COMPILERS: ${{ github.event.inputs.COMPILER }}
PATCH_KSU: ${{ github.event.inputs.KSU }}
SUFFIX: ${{ github.event.inputs.SUFFIX }}
zipper_repo: ${{ github.event.inputs.ZREPO }}
zipper_branch: ${{ github.event.inputs.ZBRANCH }}
TZ: Asia/Ho_Chi_Minh
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ github.event.inputs.CONTAINER }}
steps:
- name: checkout
uses: actions/checkout@master
- name: why
run: |
echo WORKFLOW_START=$(date +"%s") >> $GITHUB_ENV
ALT_RECIPENT=${{ github.event.inputs.TG_RECIPENT }}
if [ ! -z $ALT_RECIPENT ]; then
echo CHAT_ID="$ALT_RECIPENT" >> $GITHUB_ENV
fi
- name: start of workflow
run: |
bash tg_utils.sh msg "gh $RUN_NUM: workflow started"
- name: init build env
run: |
dnf group install development-tools -y
dnf install which llvm lld bc bison ca-certificates curl flex glibc-devel.i686 glibc-devel binutils-devel openssl python3 python2 zstd clang gcc-arm-linux-gnu dtc libxml2 libarchive openssl-devel perl tomsfastmath-devel wget xz -y
ln -sf "/usr/bin/python3" /usr/bin/python
git config --global user.name "John Doe"
git config --global user.email "idk@example.com"
- name: show host info
run: |
if [ ! -z "$VERBOSE" ]; then
bash tg_utils.sh msg "gh $RUN_NUM: build env initialized%nlgh $RUN_NUM: host: $(cat /etc/os-release | grep PRETTY_NAME | cut -d'=' -f2)%nlgh $RUN_NUM: free disk space: $(df --sync -BM --output=avail / | grep -v Avail)"
fi
- name: print notes if exists
run: |
if [ ! -z "$NOTE" ]; then
bash tg_utils.sh msg "gh $RUN_NUM: $NOTE"
fi
- name: clone kernel source
run: |
if [ ! -z "$VERBOSE" ]; then
bash tg_utils.sh msg "gh $RUN_NUM: cloning kernel source%nlgh $RUN_NUM: repo: $REPO%nlgh $RUN_NUM: branch: $KERNEL_BRANCH"
fi
git clone --depth=1 --single-branch $REPO -b $KERNEL_BRANCH kernel
- name: print kernel info
run: |
cd kernel
source ../env
bash ../tg_utils.sh msg "gh $RUN_NUM: kernel name: ${kernel_name}%nlgh $RUN_NUM: kernel ver: ${kernel_ver}%nlgh $RUN_NUM: kernel head commit: ${kernel_head}%nlgh $RUN_NUM: defconfig: ${defconfig}"
- name: run compilation scripts
run: |
cd kernel
case $PATCH_KSU in
"both" )
bash ../tg_utils.sh msg "gh $RUN_NUM: running compilation script(s): $COMPILERS"
bash ../build.sh "$COMPILERS"
bash ../tg_utils.sh msg "gh $RUN_NUM: KernelSU patching enabled, patching"
bash ../ksu/ksu.sh
bash ../tg_utils.sh msg "gh $RUN_NUM: running compilation script(s): $COMPILERS"
bash ../build.sh "$COMPILERS"
;;
"ksu" )
bash ../tg_utils.sh msg "gh $RUN_NUM: ReSukiSU patching enabled, patching"
bash ../ksu/ksu.sh
bash ../tg_utils.sh msg "gh $RUN_NUM: running compilation script(s): $COMPILERS"
bash ../build.sh "$COMPILERS"
;;
"susfs" )
bash ../tg_utils.sh msg "gh $RUN_NUM: ReSukiSU patching enabled, patching"
bash ../ksu/susfs.sh
bash ../tg_utils.sh msg "gh $RUN_NUM: running compilation script(s): $COMPILERS"
bash ../build.sh "$COMPILERS" || true
;;
"" )
bash ../tg_utils.sh msg "gh $RUN_NUM: running compilation script(s): $COMPILERS"
bash ../build.sh "$COMPILERS"
;;
esac
- name: upload
run: |
cd kernel
if [[ $(ls *.zip) ]]; then
for file in *.zip ; do
bash ../tg_utils.sh up "${file}" "$(cat "${file}.info")"
done
fi
if [[ $(ls *.log) ]]; then
for file in *.log ; do
if [ -e "${file}.info" ]; then
bash ../tg_utils.sh up "${file}" "$(cat "${file}.info")"
fi
done
fi
- name: if it fails
if: ${{ failure() }}
run: |
WORKFLOW_END=$(date +"%s")
WDIFF=$((WORKFLOW_END - WORKFLOW_START))
bash tg_utils.sh msg "gh $RUN_NUM: workflow failed in $((WDIFF / 60))m, $((WDIFF % 60))s"
- name: end of workflow
run: |
WORKFLOW_END=$(date +"%s")
WDIFF=$((WORKFLOW_END - WORKFLOW_START))
bash tg_utils.sh msg "gh $RUN_NUM: workflow ended in $((WDIFF / 60))m, $((WDIFF % 60))s"