From 850b291430fa2c5fe43011225f620fb64b1bbd84 Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Thu, 15 Feb 2024 12:49:30 -0500 Subject: [PATCH] Add option to include recovery installer --- .github/workflows/Recovery Build.yml | 40 +++++++++++++++++++++++++++- templates/installer.xml | 4 +++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 templates/installer.xml diff --git a/.github/workflows/Recovery Build.yml b/.github/workflows/Recovery Build.yml index 6c25c7174..455c3285c 100644 --- a/.github/workflows/Recovery Build.yml +++ b/.github/workflows/Recovery Build.yml @@ -44,6 +44,11 @@ on: - vendor_boot required: true default: 'recovery' + RECOVERY_INSTALLER: + description: 'Include recovery installer zip' + type: boolean + required: true + default: false jobs: build: @@ -60,6 +65,7 @@ jobs: echo "Device Path: ${{ inputs.DEVICE_PATH }}" echo "Device Name: ${{ inputs.DEVICE_NAME }}" echo "Build Target: ${{ inputs.BUILD_TARGET }}.img" + echo "Include Recovery Installer: ${{ inputs.RECOVERY_INSTALLER }}" echo "::endgroup::" # You might want to Checkout your repo first, but not mandatory @@ -120,7 +126,7 @@ jobs: - name: Create roomservice.xml run: | mkdir -p .repo/local_manifests - cp -f ${GITHUB_WORKSPACE}/templates/roomservice.xml .repo/local_manifests/ + cp -f ${GITHUB_WORKSPACE}/templates/*.xml .repo/local_manifests/ working-directory: workspace - name: Clone device tree (TeamWin) @@ -180,6 +186,32 @@ jobs: working-directory: workspace continue-on-error: true + - name: Include Recovery Installer + if: inputs.RECOVERY_INSTALLER == true && inputs.MANIFEST_BRANCH != '6.0' && inputs.BUILD_TARGET != 'vendor_boot' + run: | + case ${{ inputs.MANIFEST_BRANCH }} in + 7.1) + patchNum=5080 + ;; + 8.1) + patchNum=5079 + ;; + 9.0) + patchNum=5037 + ;; + 11) + patchNum=4964 + ;; + 12.1) + patchNum=5445 + ;; + esac + source build/envsetup.sh + repopick ${patchNum} + export USE_RECOVERY_INSTALLER=true + export RECOVERY_INSTALLER_PATH=bootable/recovery/installer + working-directory: workspace + - name: Install Python 2 if: ${{ steps.buildtree.outputs.value == 'omni' }} run: | @@ -192,6 +224,11 @@ jobs: run: | source build/envsetup.sh export ALLOW_MISSING_DEPENDENCIES=true + echo -e "USE_RECOVERY_INSTALLER=${USE_RECOVERY_INSTALLER}" + echo -e "RECOVERY_INSTALLER_PATH=${RECOVERY_INSTALLER_PATH}" + if [ -z "${USE_RECOVERY_INSTALLER}" ] && [ ${{ inputs.RECOVERY_INSTALLER }} = true ]; then + export USE_RECOVERY_INSTALLER=true && export RECOVERY_INSTALLER_PATH=bootable/recovery/installer + fi lunch twrp_${{ inputs.DEVICE_NAME }}-eng && make $(tr -d _ <<< ${{ inputs.BUILD_TARGET }})image -j$(nproc --all) working-directory: workspace @@ -208,6 +245,7 @@ jobs: with: files: | workspace/out/target/product/${{ inputs.DEVICE_NAME }}/${{ inputs.BUILD_TARGET }}.img + workspace/out/target/product/${{ inputs.DEVICE_NAME }}/*installer*zip workspace/out/target/product/${{ inputs.DEVICE_NAME }}/obj/PACKAGING/vendor_ramdisk_fragments_intermediates/recovery.* workspace/out/target/product/${{ inputs.DEVICE_NAME }}/ramdisk-recovery.* name: ${{ inputs.DEVICE_NAME }} (TWRP) diff --git a/templates/installer.xml b/templates/installer.xml new file mode 100644 index 000000000..0cdfa5f98 --- /dev/null +++ b/templates/installer.xml @@ -0,0 +1,4 @@ + + + +