Skip to content

Commit

Permalink
Update TWRP-Recovery-Builder.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kinguser981 authored Oct 6, 2024
1 parent b3e6682 commit f9f710d
Showing 1 changed file with 34 additions and 39 deletions.
73 changes: 34 additions & 39 deletions .github/workflows/TWRP-Recovery-Builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ on:
DEVICE_TREE:
description: 'Custom Recovery Tree'
required: true
default: 'https://github.com/kinguser981/android_device_samsung_a05s.git'
default: 'https://github.com/kinguser981/cap_sprout_twrp.git'
DEVICE_TREE_BRANCH:
description: 'Custom Recovery Tree Branch'
required: true
default: 'android-14'
default: 'Master-TWRP-12.1'
DEVICE_PATH:
description: 'Specify your Device Path'
required: true
default: 'device/samsung/a05s'
default: 'device/nokia/cap_sprout'
DEVICE_NAME:
description: 'Specify your Device Codename'
required: true
default: 'a05s'
default: 'cap_sprout'
BUILD_TARGET:
description: 'Specify your Build Target'
required: true
Expand Down Expand Up @@ -167,73 +167,68 @@ jobs:
run: |
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Check if Recovery Exist
run: |
cd workspace
if [ -f out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery.img ]; then
echo "RECOVERY_TYPE=recovery" >> $GITHUB_ENV
echo "recovery.img file found!"
echo "MD5_IMG=$(md5sum out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}.img | cut -d ' ' -f 1)" >> $GITHUB_ENV
elif [ -f out/target/product/${{ github.event.inputs.DEVICE_NAME }}/boot.img ]; then
echo "RECOVERY_TYPE=boot" >> $GITHUB_ENV
echo "boot.img file found!"
echo "MD5_IMG=$(md5sum out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}.img | cut -d ' ' -f 1)" >> $GITHUB_ENV
elif [ -f out/target/product/${{ github.event.inputs.DEVICE_NAME }}/vendor_boot.img ]; then
echo "RECOVERY_TYPE=vendor_boot" >> $GITHUB_ENV
echo "vendor_boot.img file found!"
echo "MD5_IMG=$(md5sum out/target/product/${{ github.event.inputs.DEVICE_NAME }}/vendor_boot.img | cut -d ' ' -f 1)" >> $GITHUB_ENV
else
echo "No Recovery file found!"
cd Exit
fi
- name: Include Recovery Installer
run: |
if [ ${{ github.event.inputs.RECOVERY_INSTALLER }} = true ]; then
cd workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/
wget https://github.com/kinguser981/recovery-installer/releases/download/zip/recovery-installer.zip
zip -ur recovery-installer.zip recovery.img
zip -ur recovery-installer.zip ${{ env.RECOVERY_TYPE }}.img
fi
continue-on-error: true

- name: Recovery to tar for Samsung devices
run: |
if [ ${{ github.event.inputs.RECOVERY_TAR }} = true ]; then
cd workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/
tar -cvf recovery.tar recovery.img
tar -cvf ${{ env.RECOVERY_TYPE }}.tar ${{ env.RECOVERY_TYPE }}.img
fi
continue-on-error: true
- name: Release recovery files
uses: softprops/action-gh-release@v1
with:
files: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery.tar
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery-installer.zip
name: Unofficial TWRP for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Build: ${{ github.event.inputs.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.
continue-on-error: true

- name: Upload to Release (boot and recovery)
if: github.event.inputs.BUILD_TARGET == 'boot' || github.event.inputs.BUILD_TARGET == 'recovery'
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}.img
name: Unofficial TWRP for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Build: ${{ github.event.inputs.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: Upload to Release (if vendor_boot)
if: github.event.inputs.BUILD_TARGET == 'vendorboot'
uses: softprops/action-gh-release@v1
with:
files: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/vendor_boot.img
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ env.RECOVERY_TYPE }}.tar
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery-installer.zip
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ env.RECOVERY_TYPE }}.img
name: Unofficial TWRP for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Build: ${{ github.event.inputs.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: Release ramdisk-recovery
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
files: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/obj/PACKAGING/vendor_ramdisk_fragments_intermediates/recovery.*
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/ramdisk-recovery.*
name: ${{ github.event.inputs.DEVICE_NAME }} (TWRP)
name: Unofficial TWRP for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }}
Target: ${{ github.event.inputs.BUILD_TARGET}}.img
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.
MD5 (img): ${{ env.MD5_IMG }}
- name: Run LDCheck
run: |
Expand Down

0 comments on commit f9f710d

Please sign in to comment.