Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonyha7 authored Oct 8, 2022
0 parents commit 84e2a3d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Gen

on:
workflow_dispatch:
inputs:
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: '3.9'
cache: 'pip'

- name: 准备twrpdtgen
run: pip install -r requirements.txt

- name: 下载
run: wget ${{ github.event.inputs.IMG }}

- name: Start build
run: |
mkdir dt
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 }}

0 comments on commit 84e2a3d

Please sign in to comment.