forked from lazycodebuilder/Lazy_Action-Recoverys-Builder
-
Notifications
You must be signed in to change notification settings - Fork 1
183 lines (167 loc) · 7.51 KB
/
SkyHawk-SHRP.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
171
172
173
174
175
176
177
178
179
180
181
182
183
name: SkyHawk [SHRP]
on:
workflow_dispatch:
inputs:
MANIFEST:
description: 'SHRP Manifest'
required: true
default: 'https://github.com/SHRP/manifest.git'
MANIFEST_BRANCH:
description: 'SHRP Manifest Branch'
required: true
default: 'shrp-12.1'
type: choice
options:
- shrp-12.1
- v3_11.0
- v3_9.0
DEVICE_TREE:
description: 'Custom Recovery Tree' # Your already made Device Tree for TWRP
required: true
default: 'https://github.com/DeathgamerB/SHRP_Spacewar'
DEVICE_TREE_BRANCH:
description: 'Custom Recovery Tree Branch' # Your Device Tree Branch, make sure it's right.
required: true
default: 'main'
DEVICE_PATH:
description: 'Specify your Device Path' # As is, just like your DEVICE_PATH in your BoardConfig.mk
required: true
default: 'device/nothing/Spacewar'
DEVICE_NAME:
description: 'Specify your Device Codename' # As is, just like your PRODUCT_DEVICE in your device tree.
required: true
default: 'Spacewar'
BUILD_TARGET:
description: 'Specify your Build Target' # Pick among boot, recovery and vendor_boot
required: true
default: 'boot'
type: choice
options:
- boot
- recovery
- vendorboot
LDCHECK:
description: 'Use LDCHECK'
required: false
default: 'false'
type: boolean
LDCHECKPATH:
description: 'Path of blobs to check' # Use it know what kind of dependencies your missing for decryption blobs.
required: true
default: ''
type: choice
options:
- system/bin/qseecomd
- system/bin/android.hardware.gatekeeper@1.0-service-qti
- system/bin/android.hardware.keymaster@4.0-service-qti
- system/bin/android.hardware.keymaster@4.1-service-qti
jobs:
build:
name: Build SHRP by ${{ github.actor }}
runs-on: self-hosted
if: github.event.repository.owner.id == github.event.sender.id
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Display Inputs
run: |
echo "Displaying variables/inputs."
echo "Manifest Branch: ${{ github.event.inputs.MANIFEST_BRANCH }}"
echo "Device Tree: ${{ github.event.inputs.DEVICE_TREE }}"
echo "Device Branch: ${{ github.event.inputs.DEVICE_TREE_BRANCH }}"
echo "Device Path: ${{ github.event.inputs.DEVICE_PATH }}"
echo "Device Name: ${{ github.event.inputs.DEVICE_NAME }}"
echo "Build Target: ${{ github.event.inputs.BUILD_TARGET }}image"
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- 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 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 libxml2 lzop pngcrush schedtool squashfs-tools imagemagick libbz2-dev lzma ncftp qemu-user-static libstdc++-10-dev libgflags-dev python3
sudo add-apt-repository universe
- name: Install OpenJDK
uses: actions/setup-java@v3
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
continue-on-error: true
- name: Initialize Repo
run: |
mkdir android-recovery
cd android-recovery
repo init --depth=1 -u ${{ github.event.inputs.MANIFEST }} -b ${{ github.event.inputs.MANIFEST_BRANCH }}
- name: Set build target for upload
run: |
if [ ${{ github.event.inputs.BUILD_TARGET }} == 'recovery' ]; then
echo "BUILD_TARGET_NAME=recovery" >> $GITHUB_ENV
elif [ ${{ github.event.inputs.BUILD_TARGET }} == 'boot' ]; then
echo "BUILD_TARGET_NAME=boot" >> $GITHUB_ENV
else
echo "BUILD_TARGET_NAME=vendor_boot" >> $GITHUB_ENV
fi
- name: Repo Sync
run: |
cd android-recovery
repo sync -j$(nproc --all) --force-sync
- name: Clone Device Tree
run: |
cd android-recovery
git clone https://github.com/Spacewar-dev/android_kernel_nothing_sm7325.git ./kernel/nothing/sm7325 -b 14.0
git clone https://github.com/TheMuppets/proprietary_vendor_nothing_Spacewar.git ./vendor/nothing/Spacewar -b lineage-20
git clone ${{ github.event.inputs.DEVICE_TREE }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
cd ${{ github.event.inputs.DEVICE_PATH }}
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Check Build Makefile
run: |
cd android-recovery
if [ -f ${{ github.event.inputs.DEVICE_PATH }}/twrp_${{ github.event.inputs.DEVICE_NAME}}.mk ]; then
echo "DEVICE_MAKEFILE=twrp_${{ github.event.inputs.DEVICE_NAME }}" >> $GITHUB_ENV
elif [ -f ${{ github.event.inputs.DEVICE_PATH }}/omni_${{ github.event.inputs.DEVICE_NAME}}.mk ]; then
echo "DEVICE_MAKEFILE=omni_${{ github.event.inputs.DEVICE_NAME }}" >> $GITHUB_ENV
else
echo "No recovery makefile file found!"
fi
continue-on-error: true
- name: Building Image
run: |
cd android-recovery
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch ${{ env.DEVICE_MAKEFILE }}-eng && make clean && mka ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all)
echo "Done building your ${{ github.event.inputs.BUILD_TARGET }}.img"
- name: Set Build Date # Output will be use in Release
run: |
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ env.BUILD_TARGET_NAME }}.img
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/SHRP*.zip
name: Unofficial SHRP For ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Build: ${{ github.event.inputs.MANIFEST_BRANCH }}
Device: [Device Tree/Branch](${{ github.event.inputs.DEVICE_TREE }}/tree/${{ github.event.inputs.DEVICE_TREE_BRANCH }})
Commit: Most recent [commit](${{ github.event.inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building.
- name: Run LDCheck
if: github.event.inputs.LDCHECK == 'true'
run: |
cd tools
mv -n libneeds ${GITHUB_WORKSPACE}/android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery/root/
mv -n ldcheck ${GITHUB_WORKSPACE}/android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery/root/
cd ../android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery/root
python3 ldcheck -p system/lib64:vendor/lib64:system/lib:vendor/lib -d ${{ github.event.inputs.LDCHECKPATH }}
echo "Done checking missing dependencies. Review, and reconfigure your tree."
continue-on-error: true