forked from TeraaBytee/kernel_builder
-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (73 loc) · 2.73 KB
/
main.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
name: Building kernel
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: 'Neutron-Clang'
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHAT_ID: ${{ secrets.CHAT_ID }}
REPO: TelegramAt25/android_kernel_xiaomi_selene
RUN_NUM: ${{ github.run_number }}_${{ github.run_attempt }}
KERNEL_BRANCH: thirteen
COMPILERS: ${{ github.event.inputs.COMPILER }}
TZ: Asia/Ho_Chi_Minh
jobs:
build:
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: checkout
uses: actions/checkout@master
- name: start of workflow
run: |
bash tg_utils.sh msg "gh $RUN_NUM: workflow started"
- name: init build env
run: |
dnf groupinstall "Development tools" -y
dnf install 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 tomsfastmath-devel wget xz -y
ln -sf "/usr/bin/python3" /usr/bin/python
- name: show host info
run: |
bash tg_utils.sh msg "gh $RUN_NUM: build env initialized"
bash tg_utils.sh msg "gh $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)"
- name: clone kernel source
run: |
bash tg_utils.sh msg "gh $RUN_NUM: cloning kernel source%nlgh $RUN_NUM: repo: $REPO"
git clone --depth=1 https://github.com/$REPO -b $KERNEL_BRANCH kernel
- name: run compilation scripts
run: |
cd kernel
bash ../tg_utils.sh msg "gh $RUN_NUM: running compilation script(s): $COMPILERS"
bash ../build.sh "$COMPILERS"
- name: upload
run: |
cd kernel
for file in $(find . -maxdepth 1 -name '*.zip'); do
bash ../tg_utils.sh up "${file}" "$(cat '${file}.info')"
done
for file in $(find . -maxdepth 1 -name '*.log'); do
if [[ -e "error_${file}.info" ]]; do
bash ../tg_utils.sh up "${file}" "$(cat 'error_${file}.info')"
fi
done
- name: if it fails
if: ${{ failure() }}
run: |
bash tg_utils.sh msg "gh $RUN_NUM: workflow failed"
- name: end of workflow
run: |
bash tg_utils.sh msg "gh $RUN_NUM: workflow ended"