-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (83 loc) · 4.54 KB
/
manual.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
# This is a basic workflow that is manually triggered
name: TWRP Building
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
rom_link:
# Friendly description to be shown in the UI instead of 'name'
description: 'Download link for the rom that you are using'
# Input has to be provided for the workflow to run
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Setup build environment
run: |
echo "Hello ${{ github.event.inputs.rom_link }}"
sudo apt-get update && sudo apt-get install -y git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig python3 python3-pip
sudo apt-get install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
sudo rm -rf /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo curl -o /usr/local/bin/repo https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
sudo chmod a+x /usr/local/bin/repo
export DIR_CURRENT=$(pwd)
echo "DIR_CURRENT=$DIR_CURRENT" >> $GITHUB_ENV
mkdir -p $DIR_CURRENT/twrp
git clone https://github.com/vm03/payload_dumper.git $DIR_CURRENT/payload_dumper
cd $DIR_CURRENT/payload_dumper
pip3 install -r requirements.txt
wget -O $DIR_CURRENT/payload_dumper/rom.zip ${{ github.event.inputs.rom_link }} >> /dev/null
unzip rom.zip
wget -O $DIR_CURRENT/payload_dumper/magiskboot.7z https://github.com/xiaoxindada/magiskboot_ndk_on_linux/releases/download/Magiskboot-25206-35/magiskboot.7z
7z x $DIR_CURRENT/payload_dumper/magiskboot.7z
sudo cp $DIR_CURRENT/payload_dumper/out/x86_64/magiskboot /usr/local/bin/magiskboot
- name: Sync twrp source code
run: |
export DIR_CURRENT=${{ env.DIR_CURRENT }}
cd $DIR_CURRENT/twrp
git config --global user.name usrname
git config --global user.email [email protected]
repo --color=always init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
repo --color=always sync -j$(nproc --all)
git clone https://github.com/EndCredits/android_device_xiaomi_renoir-twrp -b android-13 device/xiaomi/renoir
- name: Update twrp prebuilts from input rom
run: |
export DIR_CURRENT=${{ env.DIR_CURRENT }}
cd $DIR_CURRENT/payload_dumper/
python3 payload_dumper.py payload.bin
cd output
mkdir -p dlkm boot vendor_boot
sudo mount -r vendor_dlkm.img dlkm
cd boot && magiskboot unpack ../boot.img && cd ../
cd vendor_boot && magiskboot unpack ../vendor_boot.img && cd ../
cd $DIR_CURRENT/twrp/device/xiaomi/renoir/prebuilt/renoir/modules/1.1
cp -r $DIR_CURRENT/payload_dumper/output/dlkm/lib/modules/* .
cp qti_battery_charger_main.ko qti_battery_charger_main_renoir.ko
cd $DIR_CURRENT/twrp/device/xiaomi/renoir/prebuilt/renoir
cp $DIR_CURRENT/payload_dumper/output/boot/kernel kernel
cp $DIR_CURRENT/payload_dumper/output/vendor_boot/dtb dtb
cp $DIR_CURRENT/payload_dumper/output/dtbo.img dtbo.img
- name: Starting build
run: |
export DIR_CURRENT=${{ env.DIR_CURRENT }}
cd $DIR_CURRENT/twrp
. build/envsetup.sh
lunch twrp_renoir-eng
m bootimage -j$(nproc --all)
mkdir release
cp out/target/product/renoir/boot.img release/twrp-v3.7.0-renoir-$(date +%Y%m%d-%H%M)-custom.img
echo "GENERATED_BOOTIMG=twrp-v3.7.0-renoir-$(date +%Y%m%d-%H%M)-custom.img" >> $GITHUB_ENV
- name: Upload generated bootimg
uses: actions/upload-artifact@v3
with:
name: ${{ env.GENERATED_BOOTIMG }}
path: ${{ env.DIR_CURRENT }}/twrp/release/twrp*