From 84e2a3d325c8e1f9082685950735046fd145af3c Mon Sep 17 00:00:00 2001 From: th7 <69128819+Tonyha7@users.noreply.github.com> Date: Sat, 8 Oct 2022 08:29:18 +0800 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b475c5f --- /dev/null +++ b/.github/workflows/main.yml @@ -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 }}