# mujianwu/action-recovery-builder architecture

> Architecture diagram of the GitHub repository mujianwu/action-recovery-builder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mujianwu/action-recovery-builder
- Repository: https://github.com/mujianwu/action-recovery-builder

## Overview

#### Purpose
This repository is a GitHub Actions-only build orchestrator for Android recovery images. It accepts upstream manifest and device-tree parameters, builds TWRP, OrangeFox (OFRP), or SkyHawk Recovery Project (SHRP), and publishes resulting artifacts through GitHub Releases.

#### Entry Point and Invocation
The sole execution entry point is the manually triggered GitHub Actions workflow at `.github/workflows/Make.yml`. Users fork the repository, open Actions, and supply workflow inputs such as manifest URL/branch, device repository/branch/path, and device codename.

#### Workflow Orchestration
`.github/workflows/Make.yml` is the architectural core: it receives build parameters, provisions a GitHub-hosted runner, and coordinates source acquisition, environment setup, compilation, and release publication. The 2021 redesign described in `README.md` supports multiple concurrent workflow workers through parameterized runs.

#### Source and Device Boundary
The workflow treats recovery platform sources and device definitions as external inputs:
- Recovery manifest: `LIBRARY_NAME`, `LIBRARY_URL`, `LIBRARY_BRANCH`
- Device tree: `DEVICE_URL`, `DEVICE_BRANCH`, `DEVICE_PATH`
- Build target: `DEVICE_NAME`

This separates reusable recovery source bases from device-specific board configuration. Supported upstream ecosystems include TWRP, OFRP, and SHRP, as documented in `README.md`.

#### Build Pipeline
Control flow is: manual workflow dispatch → input validation/parameter use → checkout/sync selected recovery source → clone device tree into the requested Android source path → invoke the recovery build for the target device → collect generated image artifacts. Compilation runs entirely in the CI runner rather than in a checked-in application runtime.

#### Artifact Delivery
Build outputs are intended for GitHub Releases, referenced by `README.md`’s releases link. GitHub Actions is therefore both the compute environment and deployment mechanism; GitHub/GitLab manifest and device repositories are required external source services.

#### Repository Shape
There is no application source tree, service runtime, or persistent backend. The repository consists of user documentation (`README.md`) plus automation infrastructure (`.github/workflows/Make.yml`), with GitHub Actions as the effective runtime and release storage as the final output boundary.

Main entry points: [`.github/workflows/Make.yml`](https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml) (Workflow inputs), [`README.md`](https://github.com/mujianwu/action-recovery-builder/blob/main/README.md) (Build documentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_github["GitHub Automation"]
  node_readme["Build documentation<br/>[README.md]"]
  node_workflow["Make workflow<br/>GitHub Actions workflow<br/>[Make.yml]"]
  node_dispatch["Workflow inputs<br/>workflow_dispatch parameters<br/>[Make.yml]"]
  node_releases[("GitHub Releases<br/>artifact publication")]
end

subgraph group_external["External Sources"]
  node_manifest["Recovery manifest<br/>external source definition"]
  node_device_repo["Device-tree repository<br/>external Git repository"]
end

subgraph group_pipeline["Build Pipeline"]
  node_runner{{"GitHub-hosted runner<br/>ephemeral CI runtime<br/>[Make.yml]"}}
  node_recovery_source["Recovery source base"]
  node_device_tree["Device tree<br/>board configuration source"]
  node_build{{"Recovery build<br/>target compilation<br/>[Make.yml]"}}
  node_artifacts["Recovery images<br/>build artifacts"]
end

node_user(("Repository user<br/>actor"))

node_user -->|"reads"| node_readme
node_user -->|"manually dispatches"| node_workflow
node_workflow -->|"receives"| node_dispatch
node_dispatch -->|"selects URL and branch"| node_manifest
node_dispatch -->|"selects URL and branch"| node_device_repo
node_workflow -->|"provisions"| node_runner
node_runner -->|"checks out and syncs"| node_manifest
node_manifest -->|"defines source checkout"| node_recovery_source
node_runner -->|"clones"| node_device_repo
node_device_repo -->|"provides"| node_device_tree
node_recovery_source -->|"provides recovery platform"| node_build
node_device_tree -->|"provides device configuration"| node_build
node_dispatch -->|"sets target codename"| node_build
node_build -->|"generates"| node_artifacts
node_artifacts -->|"publishes"| node_releases

click node_readme "https://github.com/mujianwu/action-recovery-builder/blob/main/README.md"
click node_workflow "https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml"
click node_dispatch "https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml"
click node_runner "https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml"
click node_build "https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_workflow,node_dispatch,node_releases toneBlue
class node_manifest,node_device_repo toneAmber
class node_runner,node_recovery_source,node_device_tree,node_build,node_artifacts toneMint
class node_user toneNeutral
```

## Components

### GitHub Automation

GitHub Actions provides the runtime and release destination.

- [Build documentation](https://github.com/mujianwu/action-recovery-builder/blob/main/README.md): documentation · Documents supported recovery ecosystems and release usage. · `README.md`
- [Make workflow](https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml): GitHub Actions workflow · Manual entry point and pipeline orchestrator. · `.github/workflows/Make.yml`
- [Workflow inputs](https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml): workflow_dispatch parameters · Manifest, device-tree, path, branch, and codename selections. · `.github/workflows/Make.yml`
- **GitHub Releases**: artifact publication · Final distribution boundary for generated images.

### External Sources

Selected at dispatch time.

- **Recovery manifest**: external source definition · Selected by library name, URL, and branch.
- **Device-tree repository**: external Git repository · Selected by URL and branch.

### Build Pipeline

Executed on an ephemeral hosted runner.

- [GitHub-hosted runner](https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml): ephemeral CI runtime · Provisions the build environment. · `.github/workflows/Make.yml`
- **Recovery source base**: TWRP / OFRP / SHRP source · Platform source synchronized from the selected manifest.
- **Device tree**: board configuration source · Cloned into the requested Android source path.
- [Recovery build](https://github.com/mujianwu/action-recovery-builder/blob/main/.github/workflows/Make.yml): target compilation · Builds the selected recovery for the device codename. · `.github/workflows/Make.yml`
- **Recovery images**: build artifacts · Generated image outputs collected from the build.

### Other components

- **Repository user**: actor · Forks the repository and starts builds.

## Connections

- Repository user → Build documentation: reads
- Repository user → Make workflow: manually dispatches
- Make workflow → Workflow inputs: receives
- Workflow inputs → Recovery manifest: selects URL and branch
- Workflow inputs → Device-tree repository: selects URL and branch
- Make workflow → GitHub-hosted runner: provisions
- GitHub-hosted runner → Recovery manifest: checks out and syncs
- Recovery manifest → Recovery source base: defines source checkout
- GitHub-hosted runner → Device-tree repository: clones
- Device-tree repository → Device tree: provides
- Recovery source base → Recovery build: provides recovery platform
- Device tree → Recovery build: provides device configuration
- Workflow inputs → Recovery build: sets target codename
- Recovery build → Recovery images: generates
- Recovery images → GitHub Releases: publishes
