Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kajal4414 authored Apr 16, 2024
1 parent c848446 commit 29e202e
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
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"
workflow_dispatch:
inputs:
ROM_URL:
description: "ROM_URL"
default: "https://sourceforge.net/projects/redznn-builds/files/spes/lineage-21.0-20240411-UNOFFICIAL-spes.zip/download"
DEVICE_NAME:
description: "DEVICE_NAME"
default: "spes"
EXTRACTED_FILES:
description: "EXTRACTED_FILES"
default: "boot.img, dtbo.img, product.img, system.img, system_ext.img"
push:
branches:
- main

jobs:
build-and-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v4
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: 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
echo -e "\n\e[31mDeleting files larger than 2GB...\e[0m"
find . -maxdepth 1 -type f -size +2G -print -delete
echo "ZIP_FILE=$(basename -a *.zip)" >> $GITHUB_ENV
echo "ZIP_FILE_SHA256=$(sha256sum *.zip | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Extract Payload
run: |
chmod u+x .github/scripts/android-ota-extractor
.github/scripts/android-ota-extractor *.zip
echo -e "\n\e[31mDeleting files larger than 2GB...\e[0m"
find . -maxdepth 1 -type f -size +2G -print -delete
echo "ZIP_FILE=$(basename -a *.zip)" >> $GITHUB_ENV
echo "ZIP_FILE_SHA256=$(sha256sum *.zip | cut -d' ' -f1)" >> $GITHUB_ENV
- 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 }}
- 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 }}

0 comments on commit 29e202e

Please sign in to comment.