Update PitchBlack-PBRP.yml
This commit is contained in:
parent
d6bf1648a5
commit
2e811956ae
148
.github/workflows/PitchBlack-PBRP.yml
vendored
148
.github/workflows/PitchBlack-PBRP.yml
vendored
@ -19,30 +19,29 @@ on:
|
|||||||
DEVICE_TREE:
|
DEVICE_TREE:
|
||||||
description: 'Custom Recovery Tree' # Your already made Device Tree for TWRP
|
description: 'Custom Recovery Tree' # Your already made Device Tree for TWRP
|
||||||
required: true
|
required: true
|
||||||
default: 'https://github.com/lazycodebuilder/recovery_rmx1851'
|
default: 'https://github.com/enter_username/repo_name'
|
||||||
DEVICE_TREE_BRANCH:
|
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
|
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:
|
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
|
required: true
|
||||||
default: ''
|
default: 'recoveryimage'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- pbrp
|
- pbrp
|
||||||
- bootimage
|
- boot
|
||||||
- recoveryimage
|
- recoveryimage
|
||||||
- vendorbootimage
|
- 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: 'system/bin/qseecomd'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -60,10 +59,10 @@ jobs:
|
|||||||
- name: Display Inputs
|
- name: Display Inputs
|
||||||
run: |
|
run: |
|
||||||
echo "Displaying variables/inputs."
|
echo "Displaying variables/inputs."
|
||||||
echo "Manifest Branch: ${{ inputs.MANIFEST_BRANCH }}"
|
echo "Manifest Branch: ${{ github.event.inputs.MANIFEST_BRANCH }}"
|
||||||
echo "Device Tree: ${{ inputs.DEVICE_TREE }}"
|
echo "Device Tree: ${{ github.event.inputs.DEVICE_TREE }}"
|
||||||
echo "Device Branch: ${{ inputs.DEVICE_TREE_BRANCH }}"
|
echo "Device Branch: ${{ github.event.inputs.DEVICE_TREE_BRANCH }}"
|
||||||
echo "Build Target: ${{ inputs.BUILD_TARGET }}"
|
echo "Build Target: ${{ github.event.inputs.BUILD_TARGET }}"
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
uses: rokibhasansagar/slimhub_actions@main
|
uses: rokibhasansagar/slimhub_actions@main
|
||||||
@ -71,11 +70,11 @@ jobs:
|
|||||||
- name: Set Swap Space
|
- name: Set Swap Space
|
||||||
uses: pierotofy/set-swap-space@master
|
uses: pierotofy/set-swap-space@master
|
||||||
with:
|
with:
|
||||||
swap-size-gb: 12
|
swap-size-gb: 24
|
||||||
|
|
||||||
- name: Check Manifest Branch
|
- name: Check Manifest Branch
|
||||||
run: |
|
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
|
echo "CHECK_LEGACY_BRANCH=false" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "CHECK_LEGACY_BRANCH=true" >> $GITHUB_ENV
|
echo "CHECK_LEGACY_BRANCH=true" >> $GITHUB_ENV
|
||||||
@ -83,6 +82,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Prepare the environment
|
- name: Prepare the environment
|
||||||
run: |
|
run: |
|
||||||
|
sudo add-apt-repository universe
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt -y upgrade
|
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
|
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: |
|
run: |
|
||||||
mkdir android-recovery
|
mkdir android-recovery
|
||||||
cd android-recovery
|
cd android-recovery
|
||||||
git config --global user.name "lazycodebuilder"
|
git config --global user.name "${{ github.actor }}"
|
||||||
git config --global user.email "154446636+lazycodebuilder@users.noreply.github.com"
|
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 ${{ inputs.MANIFEST_BRANCH }}
|
repo init --depth=1 -u https://github.com/PitchBlackRecoveryProject/manifest_pb.git -b ${{ github.event.inputs.MANIFEST_BRANCH }}
|
||||||
|
|
||||||
- name: Repo Sync
|
- name: Repo Sync
|
||||||
run: |
|
run: |
|
||||||
@ -116,90 +116,60 @@ jobs:
|
|||||||
- name: Clone Device Tree
|
- name: Clone Device Tree
|
||||||
run: |
|
run: |
|
||||||
cd android-recovery
|
cd android-recovery
|
||||||
git clone ${{ inputs.DEVICE_TREE }} -b ${{ inputs.DEVICE_TREE_BRANCH }} ./device_tree
|
git clone ${{ github.event.inputs.DEVICE_TREE }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
|
||||||
cd device_tree
|
cd ${{ github.event.inputs.DEVICE_PATH }}
|
||||||
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Extracting variables from .mk file
|
- name: Check Build Makefile
|
||||||
run: |
|
run: |
|
||||||
cd android-recovery/device_tree
|
cd android-recovery
|
||||||
# Initialize variables
|
if [ -f ${{ github.event.inputs.DEVICE_PATH }}/twrp_${{ github.event.inputs.DEVICE_NAME}}.mk ]; then
|
||||||
DEVICE_MAKEFILE=""
|
echo "DEVICE_MAKEFILE=twrp_${{ github.event.inputs.DEVICE_NAME }}" >> $GITHUB_ENV
|
||||||
DEVICE_DIRECTORY=""
|
elif [ -f ${{ github.event.inputs.DEVICE_PATH }}/omni_${{ github.event.inputs.DEVICE_NAME}}.mk ]; then
|
||||||
DEVICE_NAME=""
|
echo "DEVICE_MAKEFILE=omni_${{ github.event.inputs.DEVICE_NAME }}" >> $GITHUB_ENV
|
||||||
# Loop through each .mk file in the current directory
|
else
|
||||||
for file in *.mk; do
|
echo "No recovery makefile file found!"
|
||||||
# Extract variables using sed
|
fi
|
||||||
makefile=$(sed -n 's/^[[:space:]]*PRODUCT_NAME[[:space:]]*:=\s*\(.*\)/\1/p' "$file")
|
continue-on-error: true
|
||||||
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
|
|
||||||
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"
|
|
||||||
|
|
||||||
- name: Installing python2 for legacy builds
|
- name: Installing python2 for legacy builds
|
||||||
if: env.CHECK_LEGACY_BRANCH == 'true'
|
if: env.CHECK_LEGACY_BRANCH == 'true'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install python2 python-is-python2
|
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
|
- name: Building PitchBlack
|
||||||
run: |
|
run: |
|
||||||
cd android-recovery
|
cd android-recovery
|
||||||
source build/envsetup.sh
|
source build/envsetup.sh
|
||||||
export ALLOW_MISSING_DEPENDENCIES=true
|
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
|
- name: Set Build Date # Needed for gh-releases
|
||||||
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
|
|
||||||
run: |
|
run: |
|
||||||
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
|
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
|
- name: Upload to Release
|
||||||
uses: softprops/action-gh-release@master
|
uses: softprops/action-gh-release@master
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
android-recovery/out/target/product/${{ env.DEVICE_NAME }}/${{ env.BUILD_TARGET_NAME }}.img
|
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}_not_to_flash.img
|
||||||
android-recovery/out/target/product/${{ env.DEVICE_NAME }}/PBRP*.zip
|
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/PBRP*.zip
|
||||||
android-recovery/out/target/product/${{ env.DEVICE_NAME }}/ramdisk-recovery.*
|
android-recovery/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/ramdisk-recovery.*
|
||||||
name: Unofficial PBRP for ${{ env.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
|
name: Unofficial PBRP for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
|
||||||
tag_name: ${{ github.run_id }}
|
tag_name: ${{ github.run_id }}
|
||||||
body: |
|
body: |
|
||||||
Build: ${{ inputs.MANIFEST_BRANCH }}
|
Build: ${{ github.event.inputs.MANIFEST_BRANCH }}
|
||||||
Device: [Device Tree/Branch](${{ inputs.DEVICE_TREE }}/tree/${{ inputs.DEVICE_TREE_BRANCH }})
|
Device: [Device Tree/Branch](${{ github.event.inputs.DEVICE_TREE }}/tree/${{ github.event.inputs.DEVICE_TREE_BRANCH }})
|
||||||
Commit: Most recent [commit](${{ inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building.
|
Commit: Most recent [commit](${{ github.event.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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user