Skip to content

recovery-build

recovery-build #31

# Credits to azwhikaru & chickendrop89
# https://github.com/azwhikaru/Action-OFRP-Builder
name: recovery-build
on:
workflow_dispatch:
inputs:
SYNC_URL:
description: 'SYNC_URL'
required: true
default: 'https://gitlab.com/OrangeFox/sync.git'
MANIFEST_BRANCH:
description: 'MANIFEST_BRANCH'
required: true
default: '12.1'
DEVICE_TREE_URL:
description: 'DEVICE_TREE_URL'
required: true
default: 'https://github.com/chickendrop89/orangefox_device_xiaomi_tapas'
DEVICE_TREE_BRANCH:
description: 'DEVICE_TREE_BRANCH'
required: true
default: '12.1'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/xiaomi/tapas'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'tapas'
DEVICE_VARIANT:
description: 'DEVICE_VARIANT'
required: true
default: 'tapas/topaz-A13+'
MAKEFILE_NAME:
description: 'MAKEFILE_NAME'
required: true
default: 'twrp_tapas'
BUILD_TARGET:
description: 'BUILD_TARGET'
required: true
default: 'recovery'
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# You might want to Checkout your repo first, but not mandatory
- name: Check Out
uses: actions/checkout@v3
# Cleanup The Actions Workspace Using Custom Composite Run Actions
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- name: Initialize workspace
run: |
mkdir workspace
cd workspace
echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT
id: pwd
- name: Prepare the build environment
run: |
sudo apt-get install git aria2 -y
git clone --depth 1 https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
sed -i 's/cd -/cd ../g' setup/install_android_sdk.sh
sudo bash setup/install_android_sdk.sh
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
- name: Sync OrangeFox sources and minimal manifest
run: |
cd ${{ steps.pwd.outputs.workspace-folder }}
git clone --depth 1 ${{ github.event.inputs.SYNC_URL }}
cd sync
./orangefox_sync.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
- name: Clone device tree
run: |
cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
git clone --depth 1 ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
- name: Set up ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}
- name: Building recovery
run: |
HOME_CCACHE_DIR=${{ steps.pwd.outputs.workspace-folder }}/../.ccache
BIND_CCACHE_DIR=/mnt/ccache
echo "Creating/Binding CCACHE directories ..."
if [ ! -d "$HOME_CCACHE_DIR" ]; then
mkdir $HOME_CCACHE_DIR
fi
sudo mkdir $BIND_CCACHE_DIR
sudo mount --bind $HOME_CCACHE_DIR $BIND_CCACHE_DIR
cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
set +e
source build/envsetup.sh
set -e
lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all)
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
continue-on-error: true
- name: Check the output directory before uploading
run: |
ls -al ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/
echo
ls -al ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/
- name: Get current date
id: date
run: |
echo "builddate=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.img
${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
name: orangefox-${{ github.event.inputs.DEVICE_VARIANT }}
tag_name: ${{ steps.date.outputs.builddate }}
body: |
Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }}
Device: ${{ github.event.inputs.DEVICE_NAME }}/topaz
Releaase Date: ${{ steps.date.outputs.builddate }}
* [XDA Developers Thread](https://forum.xda-developers.com/t/unofficial-recovery-13-orangefox-recovery-project-tapas-topaz.4600157/)
This build works for both `topaz` and `tapas` variant !!!
Known Issues:
*
**Notice:**
*
Changelog:
*
Flash Instructions:
* `fastboot flash recovery xxx.img`
* `or use your existing recovery to flash the ZIP (recommended)`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}