-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
130 lines (122 loc) · 6.77 KB
/
.cirrus.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
env:
CIRRUS_CLONE_DEPTH: 1
CIRRUS_WORKING_DIR: "/tmp/ci"
TOKEN: "ENCRYPTED[9aaf5d478b7ed755a49ec6f9307c22a3cc571118818fb7f4152931262f0705d7818e0ab378e044ec3f23ca9ea0955e86]"
EMAIL: "ENCRYPTED[3bbee728d0fdd7bb88c7fd907e3e28fc5d73ebc68d73ab8b7aa9e13d5697195f4fed2feb667c845357a063887c2925c2]"
UNAME: "ENCRYPTED[9ef2cd60d778d03e947a740930e0c5093e08a965d7568382447fa2cc5ec9ed47e4543669a3ad0b25061506f22c45fc55]"
TLGTK: "ENCRYPTED[213e32fa8322b178aa2767dc48a37d3a71f87742c45f14ba09d9799b615a6a3857e8e219c30dc7cfb566b0aecf427a98]"
RCLTK: "ENCRYPTED[2f6b269fa41f270ba351ed09e7cb9b9e35b255d13140565a00e12ed96adfe1a4fe243357948352ee6d8885a5d32a7efe]"
task:
name: master
timeout_in: 2h
container:
image: dopaemon/bionic:latest
cpu: 4
memory: 8G
packages_script:
- rm -rf *
- sudo apt update
- sudo apt-get install -y python3 curl zip wget ccache rclone git-lfs bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev pigz
github_script:
- git config --global user.name "$UNAME"
- git config --global user.email "$EMAIL"
cfolder_script:
- mkdir -p /tmp/ci/Kernel
- mkdir -p /tmp/ci/Kernel/Upload
- mkdir -p /tmp/ci/Kernel/Telegram
clone_script:
- cd /tmp/ci/Kernel
- git clone -b master --single-branch https://github.com/KernelPanic-OpenSource/android_kernel_xiaomi_sweet.git /tmp/ci/Kernel/Source
- git clone -b master --single-branch --depth="1" https://github.com/kdrag0n/proton-clang.git /tmp/ci/Kernel/clang
- git clone -b master --single-branch --depth="1" https://github.com/radcolor/aarch64-linux-gnu.git /tmp/ci/Kernel/gcc64/
- git clone -b master --single-branch --depth="1" https://github.com/radcolor/arm-linux-gnueabi.git /tmp/ci/Kernel/gcc32/
export_script:
- touch ~/.kernel
- echo "export CAF="LA.UM.9.1.r1-11500-SMxxx0.0"" >> ~/.kernel
- echo "export NAME="Doraemon-Kernel-$(date +"%d%m%Y")"" >> ~/.kernel
- echo "export TIME="$(date +"%d%m%Y")"" >> ~/.kernel
- echo "export DATETG="$(date +"%d/%m/%Y")"" >> ~/.kernel
- echo "export TIMETG="$(date +"%H:%M:%S")"" >> ~/.kernel
- echo "export CC=clang" >> ~/.kernel
- echo "export ARCH=arm64" >> ~/.kernel
- echo "export SUBARCH=arm64" >> ~/.kernel
- echo "export DTC_EXT=dtc"
- echo "export CROSS_COMPILE=/tmp/ci/Kernel/gcc64/bin/aarch64-linux-gnu-" >> ~/.kernel
- echo "export CROSS_COMPILE_ARM32=/tmp/ci/Kernel/gcc32/bin/arm-linux-gnueabi-" >> ~/.kernel
- echo "export PATH="/tmp/ci/Kernel/clang/bin:${PATH}"" >> ~/.kernel
oss_kernel_script:
- source ~/.kernel
- cd /tmp/ci/Kernel/Source
- export D='"'
- echo CONFIG_LOCALVERSION="$D"-"$NAME"-OSS"$D" >> arch/arm64/configs/vendor/sweet_user_defconfig
oss_compile_script:
- source ~/.kernel
- cd /tmp/ci/Kernel/Source
- make O=out sweet_user_defconfig
- make -j$(nproc --all) O=out ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=/tmp/ci/Kernel/gcc64/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=/tmp/ci/Kernel/gcc32/bin/arm-linux-gnueabi- |& tee ~/$TIME.txt
oss_dtbo_script:
- cd /tmp/ci/Kernel/Source/out/arch/arm64/boot/
- curl https://android.googlesource.com/platform/external/avb/+/refs/heads/master/avbtool.py?format=TEXT | base64 --decode > avbtool.py
- chmod +x avbtool.py
- python3 avbtool.py add_hash_footer --image dtbo.img --partition_size=33554432 --partition_name dtbo
oss_flashable_script:
- source ~/.kernel
- mkdir -p /tmp/ci/flashable
- cd /tmp/ci/flashable
- git clone -b sweet --depth="1" https://github.com/KernelPanic-OpenSource/AnyKernel3.git zip
- cp -r /tmp/ci/Kernel/Source/out/arch/arm64/boot/Image.gz /tmp/ci/flashable/zip/
- cp -r /tmp/ci/Kernel/Source/out/arch/arm64/boot/dtbo.img /tmp/ci/flashable/zip/
- cd zip
- zip -rv9 "$NAME"-OSS.zip *
oss_zipSigner_script:
- source ~/.kernel
- cd /tmp/ci/flashable/zip/
- curl -sLo zipsigner-4.0.jar https://github.com/baalajimaestro/AnyKernel3/raw/master/zipsigner-4.0.jar
- java -jar zipsigner-4.0.jar "$NAME"-OSS.zip "$NAME"-OSS-signed.zip
- echo "export OSS_ZIP_NAME=$NAME-OSS-signed.zip" >> ~/.kernel
- mv *.zip /tmp/ci/Kernel/Upload/
clear_script:
- rm -rvf /tmp/ci/Kernel/Source/out
- rm -rvf /tmp/ci/flashable/zip
miui_kernel_script:
- source ~/.kernel
- cd /tmp/ci/Kernel/Source
- git checkout HEAD arch/arm64/configs/vendor/sweet_user_defconfig
- git fetch https://github.com/KernelPanic-OpenSource/android_kernel_xiaomi_sweet.git master-miui
- git cherry-pick fb60d33f73d3f6980800b17845273bc9506acae8
- export D='"'
- echo CONFIG_LOCALVERSION="$D"-"$NAME"-Miui"$D" >> arch/arm64/configs/vendor/sweet_user_defconfig
miui_compile_script:
- source ~/.kernel
- cd /tmp/ci/Kernel/Source
- make O=out sweet_user_defconfig
- make -j$(nproc --all) O=out ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=/tmp/ci/Kernel/gcc64/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=/tmp/ci/Kernel/gcc32/bin/arm-linux-gnueabi- |& tee ~/$TIME.txt
miui_dtbo_script:
- cd /tmp/ci/Kernel/Source/out/arch/arm64/boot/
- curl https://android.googlesource.com/platform/external/avb/+/refs/heads/master/avbtool.py?format=TEXT | base64 --decode > avbtool.py
- chmod +x avbtool.py
- python3 avbtool.py add_hash_footer --image dtbo.img --partition_size=33554432 --partition_name dtbo
miui_flashable_script:
- source ~/.kernel
- mkdir -p /tmp/ci/flashable
- cd /tmp/ci/flashable
- git clone -b sweet --depth="1" https://github.com/KernelPanic-OpenSource/AnyKernel3.git zip
- cp -r /tmp/ci/Kernel/Source/out/arch/arm64/boot/Image.gz /tmp/ci/flashable/zip/
- cp -r /tmp/ci/Kernel/Source/out/arch/arm64/boot/dtbo.img /tmp/ci/flashable/zip/
- cd zip
- zip -rv9 "$NAME"-MIUI.zip *
miui_zipSigner_script:
- source ~/.kernel
- cd /tmp/ci/flashable/zip/
- curl -sLo zipsigner-4.0.jar https://github.com/baalajimaestro/AnyKernel3/raw/master/zipsigner-4.0.jar
- java -jar zipsigner-4.0.jar "$NAME"-MIUI.zip "$NAME"-MIUI-signed.zip
- echo "export MIUI_ZIP_NAME=$NAME-MIUI-signed.zip" >> ~/.kernel
- mv *.zip /tmp/ci/Kernel/Upload/
telegram_script:
- source ~/.kernel
- curl -F document=@"/tmp/ci/Kernel/Upload/$OSS_ZIP_NAME" https://api.telegram.org/bot$TLGTK/sendDocument?chat_id=@KernelPanic_OpenSource_CI
- curl -F document=@"/tmp/ci/Kernel/Upload/$MIUI_ZIP_NAME" https://api.telegram.org/bot$TLGTK/sendDocument?chat_id=@KernelPanic_OpenSource_CI
checkout_script:
- ls /tmp/ci/Kernel/Source/out/arch/arm64/boot/
- ls /tmp/ci/flashable/zip/
- ls /tmp/ci/Kernel/Upload/