Make TWRP Device #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Make TWRP Device | |
on: | |
workflow_dispatch: | |
inputs: | |
LIBRARY_NAME: | |
description: 'LIBRARY_NAME' | |
required: true | |
default: 'Twrp_Device_Genter' | |
IMG_URL: | |
description: 'IMG_URL' | |
required: true | |
default: 'https://github.com/momo54181/action_build_twrp_device_tree/raw/main/recovery.img' | |
jobs: | |
build: | |
if: github.event.repository.owner.id == github.event.sender.id | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check Out | |
uses: actions/checkout@main | |
- name: Prepare the environment | |
run: | | |
sudo apt update | |
sudo apt -y install python python3 python3-pip python3-pip cpio wget | |
- name: Set variables | |
run: | | |
echo "name=date::$(date +%F)" >> $GITHUB_OUTPUT | |
id: var | |
- name: Install TWRP generator | |
run: | | |
pip3 install twrpdtgen | |
mkdir dt | |
- name: Download boot or recovery img | |
run: | | |
wget ${{ github.event.inputs.IMG_URL }} | |
ls | |
- name: Start build | |
run: | | |
python3 -m twrpdtgen -o dt/ *.img | |
- name: ZIP device tree | |
run: | | |
zip -r DeviceTree.zip ./dt | |
- name: Upload to Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./DeviceTree.zip | |
name: TWRP_Device_Tree-${{ github.run_id }} | |
tag_name: ${{ github.run_id }} | |
body: DeviceTree for twrp | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |