Extract image Legacy #6
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: Extract image Legacy | |
on: | |
workflow_dispatch: | |
inputs: | |
fileurl: | |
description: 'link of full OxygenOS/ColorOS file' | |
required: true | |
type: string | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
extracting-boot: | |
runs-on: ubuntu-latest | |
outputs: | |
id: ota-link | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@main | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Setup environment | |
run: | | |
sudo apt-get update && sudo apt upgrade -y | |
sudo apt-get install -y zip unzip axel | |
- name: Download OTA | |
run: | | |
wget -q --show-progress -O ota.zip "${{ github.event.inputs.fileurl }}" | |
unzip ota.zip | |
- name: Download payload dumper | |
run: | | |
pip install git+https://github.com/5ec1cff/payload-dumper | |
- name: Extracting OTA | |
run: | | |
payload_dumper --partitions boot,init_boot,recovery payload.bin | |
mv output/*.img . | |
zip boot.zip boot.img | |
zip init_boot.zip init_boot.img | |
zip recovery.zip recovery.img | |
- name: Creating release | |
run: | | |
EU="(EU)" | |
GLO="(GLO)" | |
TAG_NAME=$(grep "product_name=" META-INF/com/android/metadata | cut -d = -f 2) | |
REL_NAME=$(grep "version_name=" META-INF/com/android/metadata | sed 's/^[^=]*=//') | |
if [ $TAG_NAME == 'CPH2581' ]; then REL_NAME="$REL_NAME$GLO";elif [ $TAG_NAME == "CPH2581EEA" ]; then REL_NAME="$REL_NAME$EU";fi | |
gh release create $REL_NAME --title $(echo $REL_NAME) --notes "" boot.zip init_boot.zip recovery.zip |