Skip to content

OrangeFox - Build

OrangeFox - Build #34

name: OrangeFox - Build
# Credits to:
# https://github.com/TeamWin
# https://gitlab.com/OrangeFox
# https://github.com/azwhikaru for Recovery Builder Template
# And all Contributors in every repositories I used
on:
workflow_dispatch:
inputs:
MANIFEST_BRANCH:
description: 'OrangeFox Manifest Branch'
required: true
default: '12.1'
type: choice
options:
- 12.1
- 11.0
DEVICE_TREE:
description: 'OrangeFox Device Tree'
required: true
default: 'https://github.com/cd-Crypton/custom_recovery_tree_realme_nashc'
DEVICE_TREE_BRANCH:
description: 'OrangeFox Device Tree Branch'
required: true
default: 'android-12.1'
DEVICE_PATH:
description: 'Specify your Device Path'
required: true
default: 'device/realme/nashc'
DEVICE_NAME:
description: 'Specify your Device Codename'
required: true
default: 'nashc'
BUILD_TARGET:
description: 'Specify your Build Target'
required: true
default: 'recovery'
type: choice
options:
- boot
- recovery
- vendorboot
jobs:
build:
name: Build OFR by ${{ github.actor }}
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Clean-up
uses: rokibhasansagar/slimhub_actions@main
- name: Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 24
- name: Build Environment
run: |
sudo apt install aria2 -y
git clone https://gitlab.com/OrangeFox/misc/scripts.git -b master
cd scripts
sudo bash setup/android_build_env.sh
- name: Set-up Manifest
if: inputs.MANIFEST_BRANCH == '11.0' || inputs.MANIFEST_BRANCH == '12.1'
run: |
mkdir -p ${GITHUB_WORKSPACE}/OrangeFox
cd ${GITHUB_WORKSPACE}/OrangeFox
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git clone https://gitlab.com/OrangeFox/sync.git -b master
cd sync
./orangefox_sync.sh --branch ${{ inputs.MANIFEST_BRANCH }} --path ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
- name: Clone Snapuserd Dependencies
run: |
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
git clone --depth=1 https://android.googlesource.com/platform/external/gflags -b android-12.1.0_r4 ./external/gflags
- name: Clone Device Tree
run: |
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
git clone ${{ inputs.DEVICE_TREE }} -b ${{ inputs.DEVICE_TREE_BRANCH }} ./${{ inputs.DEVICE_PATH }}
cd ${{ inputs.DEVICE_PATH }}
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Building OrangeFox
run: |
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
set +e
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
set -e
lunch twrp_${{ inputs.DEVICE_NAME }}-eng && make clean && mka adbd ${{ inputs.BUILD_TARGET }}image
- name: Set Release Properties
run: |
echo "BUILD_DATE=$(TZ=Asia/Manila date +%Y%m%d)" >> $GITHUB_ENV
cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: |
OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}/out/target/product/${{ inputs.DEVICE_NAME }}/OrangeFox*.img
OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}/out/target/product/${{ inputs.DEVICE_NAME }}/OrangeFox*.zip
name: OrangeFox Recovery for ${{ inputs.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
## OrangeFox Recovery Build - Unofficial
Build: fox_${{ inputs.MANIFEST_BRANCH }}
Device: [Device Tree/Branch](${{ inputs.DEVICE_TREE }}/tree/${{ inputs.DEVICE_TREE_BRANCH }})
Commit: Most recent [commit](${{ inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building.