生成TWRP设备树 #16
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: 生成TWRP设备树 | |
on: | |
workflow_dispatch: | |
inputs: | |
PY: | |
description: 'Python3版本(推荐3.6/3.9)' | |
required: true | |
default: '3.9' | |
IMG: | |
description: 'IMG直链' | |
required: true | |
default: '' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out | |
uses: actions/checkout@v3 | |
- name: 准备环境 | |
run: | | |
sudo apt update | |
sudo apt -y install cpio wget | |
- name: 准备Python3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ github.event.inputs.PY }} | |
cache: 'pip' | |
- name: 准备twrpdtgen | |
run: pip3 install -r requirements.txt | |
- name: 下载 | |
run: wget ${{ github.event.inputs.IMG }} | |
- name: 跑 | |
run: | | |
mkdir out | |
python3 -m twrpdtgen -o ./out/ *.img | |
- name: 打压缩包 | |
run: | | |
cd ./out | |
zip -r -9 DeviceTree.zip ./* | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./out/DeviceTree.zip | |
name: TWRP_Device_Tree-${{ github.run_id }} | |
tag_name: ${{ github.run_id }} | |
body: DeviceTree 4 TWRP | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |