-
Notifications
You must be signed in to change notification settings - Fork 2
170 lines (157 loc) · 7.15 KB
/
built_twrp.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
159
160
161
162
163
164
165
166
167
168
169
170
name: TWRP Unofficial Build Release
on:
workflow_dispatch:
inputs:
DEVICE_NAME:
description: 'Target Device Name'
required: true
default: ''
type: choice
options:
- cannong
- messi
- X6710
- golf
- nashc
- cap_sprout
- CK8n
jobs:
build:
name: Build TWRP by ${{ github.actor }}
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Check Out
uses: actions/checkout@v4
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 24
- name: Prepare the environment
run: |
sudo apt update
sudo apt -y upgrade
sudo apt -y install gperf gcc-multilib gcc-10-multilib g++-multilib g++-10-multilib libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc bc ccache lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-gtk3-dev libxml2 lzop pngcrush schedtool squashfs-tools imagemagick libbz2-dev lzma ncftp qemu-user-static libstdc++-10-dev libtinfo5 libgflags-dev
sudo add-apt-repository universe
sudo apt -y install libncurses5
- name: Install OpenJDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Install Git-Repo
run: |
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
sudo ln -sf ~/bin/repo /usr/bin/repo
- name: Initialize Repo
run: |
mkdir twrp
cd twrp
git config --global user.name "Carlo Dee"
git config --global user.email "[email protected]"
repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
sed -i '/<remove-project name="platform\/external\/gflags" \/>/d' .repo/manifests/remove-minimal.xml
repo sync -j$(nproc --all) --force-sync
- name: Decide Recovery Tree
run: |
if [ "${{ inputs.DEVICE_NAME }}" == "cannong" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_xiaomi_cannong" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-12.1" >> $GITHUB_ENV
echo "DEVICE_LUNCH=twrp_cannong-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/xiaomi/cannong" >> $GITHUB_ENV
echo "DEVICE_TARGET=recoveryimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=recovery.img" >> $GITHUB_ENV
fi
if [ "${{ inputs.DEVICE_NAME }}" == "messi" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_realme_messi" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-12.1" >> $GITHUB_ENV
echo "DEVICE_LUNCH=twrp_messi-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/realme/messi" >> $GITHUB_ENV
echo "DEVICE_TARGET=recoveryimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=recovery.img" >> $GITHUB_ENV
fi
if [ "${{ inputs.DEVICE_NAME }}" == "X6710" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_infinix_X6710" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-14" >> $GITHUB_ENV
echo "DEVICE_LUNCH=twrp_X6710-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/infinix/X6710" >> $GITHUB_ENV
echo "DEVICE_TARGET=vendorbootimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=vendor_boot.img" >> $GITHUB_ENV
fi
if [ "${{ inputs.DEVICE_NAME }}" == "golf" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_realme_golf" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-12.1" >> $GITHUB_ENV
echo "DEVICE_LUNCH=twrp_golf-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/realme/golf" >> $GITHUB_ENV
echo "DEVICE_TARGET=recoveryimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=recovery.img" >> $GITHUB_ENV
fi
if [ "${{ inputs.DEVICE_NAME }}" == "nashc" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_realme_nashc" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-12.1" >> $GITHUB_ENV
echo "DEVICE_LUNCH=twrp_nashc-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/realme/nashc" >> $GITHUB_ENV
echo "DEVICE_TARGET=recoveryimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=recovery.img" >> $GITHUB_ENV
fi
if [ "${{ inputs.DEVICE_NAME }}" == "cap_sprout" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_nokia_cap_sprout" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-12.1" >> $GITHUB_ENV
echo "DEVICE_LUNCH=cap_sprout-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/nokia/cap_sprout" >> $GITHUB_ENV
echo "DEVICE_TARGET=recoveryimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=recovery.img" >> $GITHUB_ENV
fi
if [ "${{ inputs.DEVICE_NAME }}" == "CK8n" ]; then
echo "DEVICE_TREE=https://github.com/cdpcrp/custom_recovery_tree_tecno_CK8n" >> $GITHUB_ENV
echo "DEVICE_BRANCH=twrp-12.1" >> $GITHUB_ENV
echo "DEVICE_LUNCH=twrp_CK8n-eng" >> $GITHUB_ENV
echo "DEVICE_PATH=device/tecno/CK8n" >> $GITHUB_ENV
echo "DEVICE_TARGET=bootimage" >> $GITHUB_ENV
echo "DEVICE_BUILD=boot.img" >> $GITHUB_ENV
fi
- name: Clone Device Tree
run: |
cd twrp
git clone --depth=1 --single-branch ${{ env.DEVICE_TREE }} -b ${{ env.DEVICE_BRANCH }} ./${{ env.DEVICE_PATH }}
cd ${{ env.DEVICE_PATH }}
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Building Image
run: |
cd twrp
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch ${{ env.DEVICE_LUNCH }} && make clean && mka ${{ env.DEVICE_TARGET }}
cd out/target/product/${{ inputs.DEVICE_NAME }}
mv ${{ env.DEVICE_BUILD }} twrp-${{ github.run_id }}-${{ env.DEVICE_BUILD }}
echo "Done building your twrp-${{ github.run_id }}-${{ env.DEVICE_BUILD }}"
- name: Set Properties
run: |
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
echo -e \
"
## Unofficial TWRP Build Release
_Note: Flash at your own risk. This build were still in the process of testing. And please, only flash this on Android 14 (recovery-as-vendor_boot, header v3)._
### Notes
* To be edited...
### How to Install
* To be edited...
### Resources
* [TWRP Manifest](https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp/tree/twrp-12.1)
* [Device Tree](${{ env.DEVICE_TREE }}/tree/${{ env.DEVICE_BRANCH }})
### Credits
* To be edited...
" > changelog.txt
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: |
twrp/out/target/product/${{ inputs.DEVICE_NAME }}/twrp-${{ github.run_id }}-${{ env.DEVICE_BUILD }}
name: Release Build for ${{ inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body_path: changelog.txt