forked from Tonyha7/build_twrp_device_tree
-
Notifications
You must be signed in to change notification settings - Fork 80
57 lines (49 loc) · 1.33 KB
/
Gen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 -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 }}