Skip to content

Extract and Release #86

Extract and Release

Extract and Release #86

Workflow file for this run

name: Extract and Release
on:
workflow_dispatch:
inputs:
ROM_URL:
description: "ROM_URL"
default: "https://pixeldrain.com/api/file/WdArNVpq"
DEVICE_NAME:
description: "DEVICE_NAME"
default: "spes"
EXTRACTED_FILES:
description: "EXTRACTED_FILES"
default: "boot.img, dtbo.img, product.img, system.img, system_ext.img"
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download file
run: curl -LJO ${{ github.event.inputs.ROM_URL }}
- name: Extract Payload
run: |
chmod u+x .github/scripts/android-ota-extractor
.github/scripts/android-ota-extractor *.zip
find . -maxdepth 1 -type f -size +2G -exec sh -c '
for file do
echo -e "\n\e[31mDeleting files larger than 2 GB...\e[0m\n"
printf "%s (%.2f GB)\n" "$file" "$(stat -c %s "$file" | awk "{printf \"%.2f\", \$1 / (1024*1024*1024)}")"
rm "$file"
done
' sh {} +
- name: Upload to Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ github.event.inputs.EXTRACTED_FILES }}
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: |
Device: ${{ github.event.inputs.DEVICE_NAME }}
Filename: [${{ env.ZIP_FILE }}](${{ github.event.inputs.ROM_URL }})
Extracted files: ${{ github.event.inputs.EXTRACTED_FILES }}
SHA256: ${{ env.ZIP_FILE_SHA256 }}