Merge pull request #2 from Xpsoted/main

添加COMMON TREE的支持
This commit is contained in:
Aizawa Hikaru 2021-10-31 21:49:26 +08:00 committed by GitHub
commit 92c1aa3e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 127 additions and 7 deletions

View File

@ -14,23 +14,23 @@ on:
LIBRARY_BRANCH:
description: 'LIBRARY_BRANCH'
required: true
default: 'twrp-9.0'
default: 'twrp-10.0'
DEVICE_URL:
description: 'DEVICE_URL'
required: true
default: 'https://github.com/azwhikaru/twrp_device_xiaomi_archytas'
default: 'https://github.com/Xpsoted/android_device_qualcomm_qrd855-TWRP'
DEVICE_BRANCH:
description: 'DEVICE_BRANCH'
required: true
default: 'twrp-9.0'
default: 'android-10'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/xiaomi/Archytas'
default: 'device/qualcomm/msmnile'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'Archytas'
default: 'msmnile'
jobs:
build:
@ -79,7 +79,7 @@ jobs:
run: |
PATH=~/bin:$PATH
cd workspace
repo sync -j$(nproc --all) -f --force-sync
repo sync -j$(nproc --all)
- name: Clone device
run: |
@ -107,4 +107,4 @@ jobs:
tag_name: ${{ github.run_id }}
body: Recovery for ${{ github.event.inputs.DEVICE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

120
.github/workflows/Make_Common.yml vendored Normal file
View File

@ -0,0 +1,120 @@
name: Make Recovery With Common Tree
on:
workflow_dispatch:
inputs:
LIBRARY_NAME:
description: 'LIBRARY_NAME'
required: true
default: 'omni'
LIBRARY_URL:
description: 'LIBRARY_URL'
required: true
default: 'https://github.com/SHRP/platform_manifest_twrp_omni.git'
LIBRARY_BRANCH:
description: 'LIBRARY_BRANCH'
required: true
default: 'v3_10.0'
DEVICE_URL:
description: 'DEVICE_URL'
required: true
default: 'https://github.com/SGCMarkus/android_device_lge_flashlmdd-twrp'
DEVICE_COMMON_URL:
description: 'DEVICE_COMMON_URL'
required: true
default: 'https://github.com/SGCMarkus/android_device_lge_sm8150-common-twrp'
DEVICE_BRANCH:
description: 'DEVICE_BRANCH'
required: true
default: 'android-10'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/lge/flashlmdd'
DEVICE_COMMON_PATH:
description: 'DEVICE_COMMON_PATH'
required: true
default: 'device/lge/sm8150-common'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'flashlmdd'
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-18.04
steps:
- name: Check Out
uses: actions/checkout@main
- name: Prepare the environment
run: |
docker rmi `docker images -q`
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
sudo apt -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo apt clean
sudo apt update
sudo apt -y install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip jq bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev imagemagick libbz2-dev libssl-dev lzma ncftp bash-completion python openjdk-8-jdk qemu-user-static
- name: Set variables
run: |
echo "::set-output name=date::$(date +%F)"
id: var
- name: Install repo
run: |
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
- name: Initialize repo
run: |
PATH=~/bin:$PATH
mkdir workspace
cd workspace
echo "::set-output name=pwd::$(pwd)"
git config --global user.name "Hikaru's Action-Build-Bot"
git config --global user.email "Android@teio.tk"
repo init --depth=1 -u ${{ github.event.inputs.LIBRARY_URL }} -b ${{ github.event.inputs.LIBRARY_BRANCH }}
id: pwd
- name: Repo Sync
run: |
PATH=~/bin:$PATH
cd workspace
repo sync -j$(nproc --all) -f --force-sync
- name: Clone device
run: |
PATH=~/bin:$PATH
cd ${{ steps.pwd.outputs.pwd }}
git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
git clone ${{ github.event.inputs.DEVICE_COMMON_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_COMMON_PATH }}
- name: Building
run: |
PATH=~/bin:$PATH
cd ${{ steps.pwd.outputs.pwd }}
export ALLOW_MISSING_DEPENDENCIES=true
source build/envsetup.sh
lunch ${{ github.event.inputs.LIBRARY_NAME }}_${{ github.event.inputs.DEVICE_NAME }}-eng
make clean
make recoveryimage -j$(nproc --all)
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery.img
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.cpio
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: Recovery for ${{ github.event.inputs.DEVICE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}