diff --git a/.github/workflows/Recovery Build.yml b/.github/workflows/Recovery Build.yml index 6c25c7174..116824285 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) @@ -176,8 +182,34 @@ jobs: if: inputs.REPOPICK_PATCHES != null run: | source build/envsetup.sh - repopick ${{ inputs.REPOPICK_PATCHES }} + repopick -g https://gerrit.twrp.me ${{ inputs.REPOPICK_PATCHES }} + 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 -g https://gerrit.twrp.me ${patchNum} working-directory: workspace + id: recoveryinstaller continue-on-error: true - name: Install Python 2 @@ -192,6 +224,10 @@ jobs: run: | source build/envsetup.sh export ALLOW_MISSING_DEPENDENCIES=true + if [ ${{ inputs.RECOVERY_INSTALLER }} = true ] && [ ${{ steps.recoveryinstaller.outcome == 'success' }}; 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 @@ -200,6 +236,10 @@ jobs: run: | source build/envsetup.sh export ALLOW_MISSING_DEPENDENCIES=true + if [ ${{ inputs.RECOVERY_INSTALLER }} = true ] && [ ${{ steps.recoveryinstaller.outcome == 'success' }}; then + export USE_RECOVERY_INSTALLER=true + export RECOVERY_INSTALLER_PATH=bootable/recovery/installer + fi lunch ${{ steps.buildtree.outputs.value }}_${{ inputs.DEVICE_NAME }}-eng && make ${{ inputs.BUILD_TARGET }}image -j$(nproc --all) working-directory: workspace @@ -208,6 +248,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 @@ + + + +