From 038f150e1bd0ed4e485241d95d11f4d10e94fef6 Mon Sep 17 00:00:00 2001 From: ragebreaker <125530737+mlm-games@users.noreply.github.com> Date: Sat, 17 Aug 2024 21:05:30 +0530 Subject: [PATCH] Update OrangeFox-OFRP.yml LDCHECK 1/2 --- .github/workflows/OrangeFox-OFRP.yml | 206 +++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) diff --git a/.github/workflows/OrangeFox-OFRP.yml b/.github/workflows/OrangeFox-OFRP.yml index dcb34af..cd5b91b 100644 --- a/.github/workflows/OrangeFox-OFRP.yml +++ b/.github/workflows/OrangeFox-OFRP.yml @@ -142,3 +142,209 @@ jobs: Commit: Most recent [commit](${{ inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building. MD5 (img): ${{ env.MD5_IMG }} MD5 (zip): ${{ env.MD5_ZIP }} +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: '' + type: choice + options: + - shrp-12.1 + - v3_9.0 + - v3_10.0 + - v3_11.0 + DEVICE_TREE: + description: 'Custom Recovery Tree' # Your already made Device Tree for TWRP + required: true + default: 'https://github.com/mlm-games/twrp_lenovo_7305x_m7_mt8765_P' + DEVICE_TREE_BRANCH: + description: 'Custom Recovery Tree Branch' # Your Device Tree Branch, make sure it's right. + required: true + default: 'shrp-9.0' + DEVICE_PATH: + description: 'Specify your Device Path' # As is, just like your DEVICE_PATH in your BoardConfig.mk + required: true + default: 'device/lenovo/mt8765_P' + DEVICE_NAME: + description: 'Specify your Device Codename' # As is, just like your PRODUCT_DEVICE in your device tree. + required: true + default: 'mt8765_P' + BUILD_TARGET: + description: 'Specify your Build Target' # Pick among boot, recovery and vendor_boot + required: true + default: 'recovery' + 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: 'system/bin/qseecomd' + +jobs: + build: + name: Build SHRP by ${{ github.actor }} + runs-on: ubuntu-20.04 + if: github.event.repository.owner.id == github.event.sender.id + env: + OUTPUT_DIR: android-recovery/out/target/product + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - name: Check Out + uses: actions/checkout@v4 + + - 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 "Build Target: ${{ github.event.inputs.BUILD_TARGET }}image" + + - name: Cleanup + uses: rokibhasansagar/slimhub_actions@main + + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 12 + + - name: Check Manifest Branch + run: | + if [ ${{ github.event.inputs.MANIFEST_BRANCH }} == 'v3_11.0' ] || [ ${{ github.event.inputs.MANIFEST_BRANCH }} == 'shrp-12.1' ]; then + echo "CHECK_LEGACY_BRANCH=false" >> $GITHUB_ENV + else + echo "CHECK_LEGACY_BRANCH=true" >> $GITHUB_ENV + fi + + - 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 libncurses5 python3 + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: "10G" + + - 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 android-recovery + cd android-recovery + 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 ${{ github.event.inputs.MANIFEST }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} + + - name: Repo Sync + run: | + cd android-recovery + repo sync -j$(nproc --all) --force-sync --no-clone-bundle --no-tags + + - name: Clone Device Tree + run: | + cd android-recovery + 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: Installing python2 for legacy builds + if: env.CHECK_LEGACY_BRANCH == 'true' + run: | + sudo apt-get install python2 python-is-python2 + + - name: Building SkyHawk + 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: Check if the recovery exists + if: always() + run: | + img_file=$(find "${{ env.OUTPUT_DIR }}" -name "${{ inputs.BUILD_TARGET }}*.img" -print -quit) + zip_file=$(find "${{ env.OUTPUT_DIR }}" -name "pbrp*.zip" -print -quit) + if [ -f "$img_file" ]; then + echo "CHECK_IMG_IS_OK=true" >> $GITHUB_ENV + echo "MD5_IMG=$(md5sum "$img_file" | cut -d ' ' -f 1)" >> $GITHUB_ENV + else + echo "Recovery out directory is empty." + fi + if [ -f "$zip_file" ]; then + echo "CHECK_ZIP_IS_OK=true" >> $GITHUB_ENV + echo "MD5_ZIP=$(md5sum "$zip_file" | cut -d ' ' -f 1)" >> $GITHUB_ENV + else + echo "::warning::The zip file isn't present but make sure the image is from only after 100% completion in build stage" + fi + + - name: Set Build Date # Output will be use in Release + run: | + echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV + + - name: Upload to Release + if: always() && env.CHECK_IMG_IS_OK == 'true' + uses: softprops/action-gh-release@master + with: + files: | + ${{ env.OUTPUT_DIR }}/${{ github.event.inputs.DEVICE_NAME }}/${{ inputs.BUILD_TARGET }}.img + ${{ env.OUTPUT_DIR }}/${{ github.event.inputs.DEVICE_NAME }}/SHRP*.zip + ${{ env.OUTPUT_DIR }}/${{ github.event.inputs.DEVICE_NAME }}/ramdisk*.* + name: Unofficial SHRP For ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }} + tag_name: ${{ github.run_id }} + body: | + Build: ${{ env.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