Update PitchBlack-PBRP.yml

This commit is contained in:
ragebreaker 2024-08-15 16:00:57 +05:30 committed by GitHub
parent d6bf1648a5
commit 2e811956ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,30 +19,29 @@ on:
DEVICE_TREE:
description: 'Custom Recovery Tree' # Your already made Device Tree for TWRP
required: true
default: 'https://github.com/lazycodebuilder/recovery_rmx1851'
default: 'https://github.com/enter_username/repo_name'
DEVICE_TREE_BRANCH:
description: 'Custom Recovery Tree Branch' # Your Device Tree Branch, make sure it's right.
description: 'Your Custom Recovery Tree Branch' # Your Device Tree Branch, make sure it's right.
required: true
default: 'android-14_pbrp'
default: 'master'
DEVICE_NAME:
description: 'Specify your Device Codename' # As is, just like your PRODUCT_DEVICE in your device tree.
required: true
default: '7304X'
DEVICE_PATH:
description: 'Specify your Device Path (Check the DEVICE_PATH in BoardConfig.mk)' # As is, just like your DEVICE_PATH in your BoardConfig.mk
required: true
default: 'device/device`s_company/Codename'
BUILD_TARGET:
description: 'Specify your Build Target' # Pick among boot, recovery and vendor_boot
description: 'Specify your Build Target (choose "pbrp" instead of "recoveryimage" for Android 11 or above)' # Pick among boot, recovery and vendor_boot
required: true
default: ''
default: 'recoveryimage'
type: choice
options:
- pbrp
- bootimage
- boot
- recoveryimage
- vendorbootimage
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: 'system/bin/qseecomd'
- vendorboot
jobs:
build:
@ -60,10 +59,10 @@ jobs:
- name: Display Inputs
run: |
echo "Displaying variables/inputs."
echo "Manifest Branch: ${{ inputs.MANIFEST_BRANCH }}"
echo "Device Tree: ${{ inputs.DEVICE_TREE }}"
echo "Device Branch: ${{ inputs.DEVICE_TREE_BRANCH }}"
echo "Build Target: ${{ inputs.BUILD_TARGET }}"
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 "Build Target: ${{ github.event.inputs.BUILD_TARGET }}"
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
@ -71,11 +70,11 @@ jobs:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
swap-size-gb: 24
- name: Check Manifest Branch
run: |
if [ ${{ inputs.MANIFEST_BRANCH }} == 'android-11.0' ] || [ ${{ inputs.MANIFEST_BRANCH }} == 'android-12.1' ]; then
if [ ${{ github.event.inputs.MANIFEST_BRANCH }} == 'android-11.0' ] || [ ${{ github.event.inputs.MANIFEST_BRANCH }} == 'android-12.1' ]; then
echo "CHECK_LEGACY_BRANCH=false" >> $GITHUB_ENV
else
echo "CHECK_LEGACY_BRANCH=true" >> $GITHUB_ENV
@ -83,6 +82,7 @@ jobs:
- name: Prepare the environment
run: |
sudo add-apt-repository universe
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 libncurses5 python3
@ -104,9 +104,9 @@ jobs:
run: |
mkdir android-recovery
cd android-recovery
git config --global user.name "lazycodebuilder"
git config --global user.email "154446636+lazycodebuilder@users.noreply.github.com"
repo init --depth=1 -u https://github.com/PitchBlackRecoveryProject/manifest_pb.git -b ${{ inputs.MANIFEST_BRANCH }}
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
repo init --depth=1 -u https://github.com/PitchBlackRecoveryProject/manifest_pb.git -b ${{ github.event.inputs.MANIFEST_BRANCH }}
- name: Repo Sync
run: |
@ -116,90 +116,60 @@ jobs:
- name: Clone Device Tree
run: |
cd android-recovery
git clone ${{ inputs.DEVICE_TREE }} -b ${{ inputs.DEVICE_TREE_BRANCH }} ./device_tree
cd device_tree
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: Extracting variables from .mk file
- name: Check Build Makefile
run: |
cd android-recovery/device_tree
# Initialize variables
DEVICE_MAKEFILE=""
DEVICE_DIRECTORY=""
DEVICE_NAME=""
# Loop through each .mk file in the current directory
for file in *.mk; do
# Extract variables using sed
makefile=$(sed -n 's/^[[:space:]]*PRODUCT_NAME[[:space:]]*:=\s*\(.*\)/\1/p' "$file")
brand=$(sed -n 's/^[[:space:]]*PRODUCT_BRAND[[:space:]]*:=\s*\(.*\)/\1/p' "$file")
codename=$(sed -n 's/^[[:space:]]*PRODUCT_DEVICE[[:space:]]*:=\s*\(.*\)/\1/p' "$file")
if [[ -n "$makefile" && -n "$brand" && -n "$codename" ]]; then
DEVICE_MAKEFILE="$makefile"
DEVICE_DIRECTORY="device/$brand"
DEVICE_NAME="$codename"
echo "DEVICE_MAKEFILE=${DEVICE_MAKEFILE}" >> $GITHUB_ENV
echo "DEVICE_NAME=${DEVICE_NAME}" >> $GITHUB_ENV
echo "DEVICE_DIRECTORY=${DEVICE_DIRECTORY}" >> $GITHUB_ENV
break
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
done
# Navigate to the parent directory
cd ../
# Create the necessary directories
echo "Creating directory: $DEVICE_DIRECTORY"
mkdir -p "$DEVICE_DIRECTORY"
# Move device_tree folder to device_directory and rename it to $DEVICE_NAME
echo "Moving device_tree to $DEVICE_DIRECTORY/$DEVICE_NAME"
mv device_tree "$DEVICE_DIRECTORY"/"$DEVICE_NAME"
continue-on-error: true
- name: Installing python2 for legacy builds
if: env.CHECK_LEGACY_BRANCH == 'true'
run: |
sudo apt-get install python2 python-is-python2
- name: Fixed Missing Fonts
run: |
cd android-recovery
cd external/noto-fonts/other
wget https://github.com/cd-Crypton/custom-recovery-extras/raw/main/missing-font.zip
unzip -o missing-font.zip
- name: Building PitchBlack
run: |
cd android-recovery
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch ${{ env.DEVICE_MAKEFILE }}-eng && mka ${{ inputs.BUILD_TARGET }}
lunch ${{ env.DEVICE_MAKEFILE }}-eng && mka ${{ github.event.inputs.BUILD_TARGET }}
- name: Check Build Makefile
run: |
cd android-recovery
if [ -f out/target/product/${{ env.DEVICE_NAME }}/recovery.img ]; then
echo "BUILD_TARGET_NAME=recovery" >> $GITHUB_ENV
elif [ -f out/target/product/${{ env.DEVICE_NAME }}/boot.img ]; then
echo "BUILD_TARGET_NAME=boot" >> $GITHUB_ENV
else
echo "BUILD_TARGET_NAME=vendor_boot" >> $GITHUB_ENV
fi
- name: Set Build Date # Output will be use in Release
- name: Set Build Date # Needed for gh-releases
run: |
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Rename image file
run: |
IMG_PATH="android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}"
mv "${IMG_PATH}/${{ github.event.inputs.BUILD_TARGET }}.img" "${IMG_PATH}/${{ github.event.inputs.BUILD_TARGET }}_not_to_flash.img"
- name: Upload to Release
uses: softprops/action-gh-release@master
with:
files: |
android-recovery/out/target/product/${{ env.DEVICE_NAME }}/${{ env.BUILD_TARGET_NAME }}.img
android-recovery/out/target/product/${{ env.DEVICE_NAME }}/PBRP*.zip
android-recovery/out/target/product/${{ env.DEVICE_NAME }}/ramdisk-recovery.*
name: Unofficial PBRP for ${{ env.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}_not_to_flash.img
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/PBRP*.zip
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/ramdisk-recovery.*
name: Unofficial PBRP for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Build: ${{ inputs.MANIFEST_BRANCH }}
Device: [Device Tree/Branch](${{ inputs.DEVICE_TREE }}/tree/${{ inputs.DEVICE_TREE_BRANCH }})
Commit: Most recent [commit](${{ inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building.
- name: Run LDCheck
if: inputs.LDCHECK == 'true'
run: |
cd tools
mv -n libneeds ${GITHUB_WORKSPACE}/android-recovery/out/target/product/${{ env.DEVICE_NAME }}/recovery/root/
mv -n ldcheck ${GITHUB_WORKSPACE}/android-recovery/out/target/product/${{ env.DEVICE_NAME }}/recovery/root/
cd ../android-recovery/out/target/product/${{ env.DEVICE_NAME }}/recovery/root
python3 ldcheck -p system/lib64:vendor/lib64:system/lib:vendor/lib -d ${{ inputs.LDCHECKPATH }}
echo "Done checking missing dependencies. Review, and reconfigure your tree."
continue-on-error: true
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.