Skip to content

Recovery Build

Recovery Build #2

name: Recovery Build
on:
workflow_dispatch:
inputs:
SYNC_URL:
description: 'SYNC_URL'
required: true
default: 'https://github.com/zainarbani/sync'
MANIFEST_BRANCH:
description: 'MANIFEST_BRANCH'
required: true
default: '12.1'
DEVICE_TREE_URL:
description: 'DEVICE_TREE_URL'
required: true
default: 'https://github.com/zainarbani/recovery_device_redmi_rosemary-2'
DEVICE_TREE_BRANCH:
description: 'DEVICE_TREE_BRANCH'
required: true
default: 'android-12.1'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/redmi/rosemary'
COMMON_TREE_URL:
description: 'COMMON_TREE_URL (if no common tree, leave blank)'
required: false
COMMON_PATH:
description: 'COMMON_PATH (if no common tree, leave blank)'
required: false
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'rosemary'
MAKEFILE_NAME:
description: 'MAKEFILE_NAME'
required: true
default: 'twrp_rosemary'
BUILD_TARGET:
description: 'BUILD_TARGET'
required: true
default: 'boot'
jobs:
build:
runs-on: self-hosted
container:
image: fedora:38
options: --userns=keep-id
steps:
- name: Update and install required packages
run: |
dnf install -y git aria2
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
bash setup/android_build_env.sh
sed -i 's/cd -/cd ../g' setup/install_android_sdk.sh
bash setup/install_android_sdk.sh
working-directory: /workspace
- name: Sync OrangeFox sources and minimal manifest
run: |
git clone ${{ github.event.inputs.SYNC_URL }}
cd sync
./orangefox_sync.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path /workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
working-directory: /workspace
- name: Clone device tree
run: |
cd /workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
git clone ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
working-directory: /workspace
- name: Clone common tree
if: github.event.inputs.COMMON_TREE_URL != null && github.event.inputs.COMMON_PATH != null
run: |
cd /workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
git clone ${{ github.event.inputs.COMMON_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.COMMON_PATH }}
working-directory: /workspace
- name: Building recovery
run: |
cd /workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
set +e
rm -rf .repo
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
set -e
lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all)
working-directory: /workspace
continue-on-error: true
- name: Check the output directory before uploading
run: |
ls -al /workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/
echo
ls -al /workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
/workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.img
/workspace/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: |
Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }}
Device: ${{ github.event.inputs.DEVICE_NAME }}
Target: ${{ github.event.inputs.BUILD_TARGET }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}