179 lines
7.6 KiB
YAML
179 lines
7.6 KiB
YAML
name: OrangeFox [OFRP]
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
MANIFEST_BRANCH:
|
|
description: 'OrangeFox Manifest Branch'
|
|
required: true
|
|
default: '12.1'
|
|
type: choice
|
|
options:
|
|
- 12.1
|
|
- 11.0
|
|
- 10.0
|
|
- 9.0
|
|
- 8.1
|
|
- 7.1
|
|
- 6.0
|
|
DEVICE_TREE:
|
|
description: 'Custom Recovery Tree'
|
|
required: true
|
|
default: 'https://github.com/lazycodebuilder/recovery_rmx1851'
|
|
DEVICE_TREE_BRANCH:
|
|
description: 'Custom Recovery Tree Branch'
|
|
required: true
|
|
default: 'android-14_ofrp'
|
|
DEVICE_PATH:
|
|
description: 'Specify your device path.'
|
|
required: true
|
|
default: 'device/realme/RMX1851'
|
|
DEVICE_NAME:
|
|
description: 'Specify your Device Codename.'
|
|
required: true
|
|
default: 'RMX1851'
|
|
BUILD_TARGET:
|
|
description: 'Specify your Build Target'
|
|
required: true
|
|
default: 'recovery'
|
|
type: choice
|
|
options:
|
|
- boot
|
|
- recovery
|
|
- vendorboot
|
|
LDCHECK:
|
|
description: 'Use LDCHECK'
|
|
required: false
|
|
default: 'false'
|
|
type: boolean
|
|
LDCHECKPATH:
|
|
description: 'Path of blobs to check' # Use it know what kind of dependencies your missing for decryption blobs.
|
|
required: true
|
|
default: 'system/bin/qseecomd'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build OFRP by ${{ github.actor }}
|
|
runs-on: ubuntu-latest
|
|
if: github.event.repository.owner.id == github.event.sender.id
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Display Inputs
|
|
run: |
|
|
echo "Displaying variables/inputs."
|
|
echo "Manifest Branch: ${{ github.event.inputs.MANIFEST_BRANCH }}"
|
|
echo "Device Tree: ${{ github.event.inputs.DEVICE_TREE }}"
|
|
echo "Device Branch: ${{ github.event.inputs.DEVICE_TREE_BRANCH }}"
|
|
echo "Device Path: ${{ github.event.inputs.DEVICE_PATH }}"
|
|
echo "Device Name: ${{ github.event.inputs.DEVICE_NAME }}"
|
|
echo "Build Target: ${{ github.event.inputs.BUILD_TARGET }}image"
|
|
|
|
- name: Clean-up
|
|
uses: rokibhasansagar/slimhub_actions@main
|
|
|
|
- name: Swap Space
|
|
uses: pierotofy/set-swap-space@master
|
|
with:
|
|
swap-size-gb: 12
|
|
|
|
- name: Build Environment
|
|
run: |
|
|
sudo apt install aria2 -y
|
|
git clone https://gitlab.com/OrangeFox/misc/scripts
|
|
cd scripts
|
|
sudo bash setup/android_build_env.sh
|
|
|
|
- name: Set-up Manifest
|
|
run: |
|
|
mkdir -p ${GITHUB_WORKSPACE}/OrangeFox
|
|
cd ${GITHUB_WORKSPACE}/OrangeFox
|
|
git config --global user.name "lazycodebuilder"
|
|
git config --global user.email "154446636+lazycodebuilder@users.noreply.github.com"
|
|
git clone https://gitlab.com/OrangeFox/sync.git
|
|
if [ ${{ github.event.inputs.MANIFEST_BRANCH }} == '11.0' ] || [ ${{ github.event.inputs.MANIFEST_BRANCH }} == '12.1' ]; then
|
|
echo "Sync fox_${{ github.event.inputs.MANIFEST_BRANCH }} branch"
|
|
cd sync
|
|
./orangefox_sync.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
|
|
else
|
|
echo "Sync legacy fox_${{ github.event.inputs.MANIFEST_BRANCH }} branch"
|
|
cd sync/legacy
|
|
./orangefox_sync_legacy.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
|
|
fi
|
|
|
|
- name: Clone Device Tree
|
|
run: |
|
|
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
|
|
git clone ${{ github.event.inputs.DEVICE_TREE }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
|
|
cd ${{ github.event.inputs.DEVICE_PATH }}
|
|
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
|
|
- name: Check Manifest Branch
|
|
uses: haya14busa/action-cond@v1
|
|
id: fox_branch
|
|
with:
|
|
cond: ${{ github.event.inputs.MANIFEST_BRANCH == '11.0' || github.event.inputs.MANIFEST_BRANCH == '12.1' }}
|
|
if_true: lunch twrp_${{ github.event.inputs.DEVICE_NAME }}-eng && make clean && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image
|
|
if_false: lunch omni_${{ github.event.inputs.DEVICE_NAME }}-eng && make clean && mka ${{ github.event.inputs.BUILD_TARGET }}image
|
|
|
|
- name: Building OrangeFox
|
|
run: |
|
|
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
|
|
set +e
|
|
source build/envsetup.sh
|
|
export ALLOW_MISSING_DEPENDENCIES=true
|
|
set -e
|
|
${{ steps.fox_branch.outputs.value }}
|
|
|
|
- name: Set Build Date # For Build Date Info, currently using Asia/Manila
|
|
run: |
|
|
echo "BUILD_DATE=$(TZ=Asia/Manila date +%Y%m%d)" >> $GITHUB_ENV
|
|
|
|
- name: Check if Recovery Exist
|
|
run: |
|
|
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
|
|
if [ -f out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.img ]; then
|
|
echo "CHECK_IMG_IS_OK=true" >> $GITHUB_ENV
|
|
echo "MD5_IMG=$(md5sum out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.img | cut -d ' ' -f 1)" >> $GITHUB_ENV
|
|
else
|
|
echo "Recovery out directory is empty."
|
|
fi
|
|
if [ -f out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.zip ]; then
|
|
echo "CHECK_ZIP_IS_OK=true" >> $GITHUB_ENV
|
|
echo "MD5_ZIP=$(md5sum out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.zip | cut -d ' ' -f 1)" >> $GITHUB_ENV
|
|
else
|
|
echo "Recovery out directory is empty."
|
|
fi
|
|
|
|
- name: Upload to Release
|
|
if: env.CHECK_IMG_IS_OK == 'true' && env.CHECK_ZIP_IS_OK == 'true'
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.img
|
|
OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.zip
|
|
name: Unofficial OrangeFox for ${{ github.event.inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
|
|
tag_name: ${{ github.run_id }}
|
|
body: |
|
|
Build: ${{ github.event.inputs.MANIFEST_BRANCH }}
|
|
Device: [Device Tree/Branch](${{ github.event.inputs.DEVICE_TREE }}/tree/${{ github.event.inputs.DEVICE_TREE_BRANCH }})
|
|
Commit: Most recent [commit](${{ github.event.inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building.
|
|
MD5 (img): ${{ env.MD5_IMG }}
|
|
MD5 (zip): ${{ env.MD5_ZIP }}
|
|
|
|
- name: Run LDCheck
|
|
if: github.event.inputs.LDCHECK == 'true'
|
|
run: |
|
|
cd tools
|
|
mv -n libneeds ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery/root/
|
|
mv -n ldcheck ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery/root/
|
|
cd ../OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery/root
|
|
python3 ldcheck -p system/lib64:vendor/lib64:system/lib:vendor/lib -d ${{ github.event.inputs.LDCHECKPATH }}
|
|
echo "Done checking missing dependencies. Review, and reconfigure your tree."
|
|
continue-on-error: true
|