79 lines (74 loc) · 2.8 KB
/
Dump.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: MTK Rom Dumper
on:
workflow_dispatch:
inputs:
DOWNLOAD_URL:
description: 'DOWNLOAD_URL'
required: true
default: 'https://github.com/kelexine/recovery-releases/releases/download/v4.1.1/kg5j-rom.tar.xz'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'TECNO SPARK 8C KG5j'
ROM_TYPE:
description: 'ROM_TYPE'
required: true
default: 'STOCK ROM'
FILES_TYPE:
description: 'FILES_TYPE'
required: true
default: 'ALL ROM FILES'
DIR_NAME:
description: 'DIR_NAME'
required: true
default: 'rom'
ARCHIVE_NAME:
description: 'ARCHIVE_NAME'
required: true
default: 'archive.tar.xz'
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Prepare the environment
run: |
sudo apt update
sudo apt install git aria2 wget tar simg2img python3 -y
- name: Download Archive
run: |
mkdir -p ${{ github.event.inputs.DIR_NAME }}
cd ${{ github.event.inputs.DIR_NAME }}
curl -L -o ${{ github.event.inputs.ARCHIVE_NAME }} ${{ github.event.inputs.DOWNLOAD_URL }}
ls -lah
- name: Extract and Cleanup
run: |
cp extract.sh ${{ github.event.inputs.DIR_NAME }} || echo "extract.sh not found. Proceeding without it."
cd ${{ github.event.inputs.DIR_NAME }}
tar -xJf ${{ github.event.inputs.ARCHIVE_NAME }}
wget http://newandroidbook.com/tools/imjtool.tgz && tar xzvf imjtool.tgz
simg2img super.img super.ext.img || echo "simg2img failed. Proceeding without it."
./imjtool.ELF64 super.ext.img extract || echo "imjtool extraction failed. Proceeding without it."
mv extracted/*.img . || echo "No extracted images found. Proceeding without them."
xz -z system_a.img system_ext_a.img product_a.img vendor_a.img || echo "Compression failed. Proceeding without it."
rm -f super.ext.img super.img ${{ github.event.inputs.ARCHIVE_NAME }} || echo "Cleanup failed. Proceeding without it."
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ github.event.inputs.DIR_NAME }}/*
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: |
Type: ${{ github.event.inputs.FILES_TYPE }}
Device: ${{ github.event.inputs.DEVICE_NAME }}
Target: ${{ github.event.inputs.ROM_TYPE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup Environment
run: |
rm -rf ${{ github.event.inputs.DIR_NAME }}