2.0
This commit is contained in:
Aizawa Hikaru 2021-10-29 13:37:42 +08:00
parent 2bf42a1041
commit ac95d1131d
2 changed files with 157 additions and 0 deletions

119
.github/workflows/Make.yml vendored Normal file
View File

@ -0,0 +1,119 @@
name: Make Recovery
on:
workflow_dispatch:
inputs:
LIBRARY_NAME:
description: 'LIBRARY_NAME'
required: true
default: 'omni'
LIBRARY_URL:
description: 'LIBRARY_URL'
required: true
default: 'git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git'
LIBRARY_BRANCH:
description: 'LIBRARY_BRANCH'
required: true
default: 'twrp-9.0'
DEVICE_REMOTE:
description: 'DEVICE_REMOTE'
required: true
default: 'github'
DEVICE_URL:
description: 'DEVICE_URL'
required: true
default: 'https://github.com/azwhikaru/twrp_device_xiaomi_archytas'
DEVICE_BRANCH:
description: 'DEVICE_BRANCH'
required: true
default: 'twrp-9.0'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/xiaomi/Archytas'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'Archytas'
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: Clean Up
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
- name: Install packages
run: |
sudo apt -y upgrade
- name: Install required packages
run: 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
ls -al
- name: Clone device
run: |
PATH=~/bin:$PATH
cd ${{ steps.pwd.outputs.pwd }}
git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_URL }} ./${{ github.event.inputs.DEVICE_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 }}/recovery.img
name: ${{ github.event.inputs.DEVICE_NAME }}
tag_name: ${{ github.run_id }}
body: TWRP Recovery for ${{ github.event.inputs.DEVICE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

38
README.md Normal file
View File

@ -0,0 +1,38 @@
<h1 align="center"> 利用 Github Actions 编译 Recovery</h1>
---
<p align="center">
Use Github Action to build recovery
</p>
## 配置
配置文件位于仓库根目录 [Config.json](config.json)
| 名称 | 类型 | 描述 |
| ------------------ | ------- | ------------------------------------------------------------ |
| `twrp_url` | String | 编译使用的源码地址 |
| `twrp_branch` | String | 编译使用的源码分支 |
| `git_username` | String | Git 的用户名 |
| `git_email` | String | Git 的邮箱<sub>Github 可使用`Github ID + Github用户名@users.noreply.github.com`</sub> |
| `use_own_dt` | Boolean | 指示是否使用个人设备树<sub>(此项为 `true` 后以下三项起效)</sub> |
| `dt_url` | String | 您使用的设备树的地址<sub>(格式: `USER/REPO` </sub> |
| `dt_branch` | String | 您使用的设备树的分支 |
| `dt_remote` | String | 您使用设备树的存储库<sub>(如 `github/gitlab` </sub> |
| `dt_path` | String | 指示设备树本地保存位置<sub>(示例 `device/huawei/kiwi` </sub> |
| `device_code` | String | 您将要编译机型的机型代号 |
| `use_omin_head` | Boolean | 指示设备树的 `*.mk` 文件是否包含 `omni_`<sub>(例如你的 `*.mk` 文件如同 `omni_kiwi.mk` 则需开启此选项)</sub> |
| `use_repair_manifest` | Boolean | 是否下载修复环境<sub>(注意,此项目为后面三项的前置条件。此项为 `true` 后以下四项起效) </sub> |
| `fix_product` | Boolean | 指示是否修复无法找到设备的问题 |
| `fix_misscom` | Boolean | 指示是否修复缺少 `device/qcom/common` 的问题 |
| `fix_busybox` | Boolean | 指示是否修复缺少 `busybox` 的问题 |
| `fix_branch` | String | 指示修复以上问题所使用的分支<sub>(你一般无需修改此项,只需要替换 `Android` 版本对应分支即可) </sub> |
## 开始
Fork 此仓库后,修改 [Config.json](config.json),点击右上角 Star 就会开始,你可以在 [Worker](../../actions) 界面查看进度
## 编译结果
可以在 [Release](../../releases) 下载