Skip to content

Commit

Permalink
Add option to include recovery installer
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainThrowback committed Feb 15, 2024
1 parent 2893eb2 commit ba48ec8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/Recovery Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions templates/installer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="osm0sis/twrp_abtemplate" path="bootable/recovery/installer" remote="github" revision="master" />
</manifest>

0 comments on commit ba48ec8

Please sign in to comment.