Skip to content

Commit

Permalink
Merge pull request azwhikaru#4 from CaptainThrowback/main
Browse files Browse the repository at this point in the history
Updates for newer-tree compatibility
  • Loading branch information
klabit87 authored Feb 11, 2024
2 parents 82d7fdf + ee38cb5 commit 3fdc2e3
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 28 deletions.
74 changes: 52 additions & 22 deletions .github/workflows/Recovery Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ on:
description: 'DEVICE_PATH'
required: true
default: 'device/asus/I003D'
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
Expand Down Expand Up @@ -110,19 +104,6 @@ jobs:
run: |
repo sync -j$(nproc --all) --force-sync
working-directory: workspace

- name: Clone device tree
run: |
git clone ${{ 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: Clone common tree
if: |
github.event.inputs.COMMON_TREE_URL != null
&& github.event.inputs.COMMON_PATH != null
run: |
git clone ${{ github.event.inputs.COMMON_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.COMMON_PATH }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}

- name: Check Build Tree
uses: haya14busa/action-cond@v1
Expand All @@ -132,7 +113,55 @@ jobs:
if_true: twrp
if_false: omni

- name: Sync Device Dependencies
- name: Create roomservice.xml
run: |
mkdir -p .repo/local_manifests
cp -f ${GITHUB_WORKSPACE}/templates/roomservice.xml .repo/local_manifests/
working-directory: ${{ steps.pwd.outputs.workspace-folder }}

- name: Clone device tree (TeamWin)
if: |
contains( github.event.inputs.DEVICE_TREE_URL,'/TeamWin/' )
&& steps.buildtree.outputs.value == 'twrp'
run: |
sed -i "s%\!--project name=\"{DEVICE_TREE_URL_REPO}%project name=\"$(grep -oP '(?<=TeamWin/).*' <<< ${{ github.event.inputs.DEVICE_TREE_URL }})%g" .repo/local_manifests/roomservice.xml
sed -i "s%{DEVICE_PATH}%${{ github.event.inputs.DEVICE_PATH }}%g" .repo/local_manifests/roomservice.xml
sed -i "s%{DEVICE_REMOTE_NAME}%TeamWin%g" .repo/local_manifests/roomservice.xml
sed -i "s%{DEVICE_TREE_BRANCH}\"/-->%${{ github.event.inputs.DEVICE_TREE_BRANCH }}\"/>%g" .repo/local_manifests/roomservice.xml
repo sync -j$(nproc --all)
working-directory: ${{ steps.pwd.outputs.workspace-folder }}

- name: Clone device tree (Github)
if: |
!contains( github.event.inputs.DEVICE_TREE_URL,'/TeamWin/' )
&& steps.buildtree.outputs.value == 'twrp'
run: |
sed -i "s%\!--project name=\"{DEVICE_TREE_URL_REPO}%project name=\"$(grep -oP '(?<=github.com/).*' <<< ${{ github.event.inputs.DEVICE_TREE_URL }})%g" .repo/local_manifests/roomservice.xml
sed -i "s%{DEVICE_PATH}%${{ github.event.inputs.DEVICE_PATH }}%g" .repo/local_manifests/roomservice.xml
sed -i "s%{DEVICE_REMOTE_NAME}%github%g" .repo/local_manifests/roomservice.xml
sed -i "s%{DEVICE_TREE_BRANCH}\"/-->%${{ github.event.inputs.DEVICE_TREE_BRANCH }}\"/>%g" .repo/local_manifests/roomservice.xml
repo sync -j$(nproc --all)
working-directory: ${{ steps.pwd.outputs.workspace-folder }}

- name: Clone device tree (Omni)
if: ${{ steps.buildtree.outputs.value == 'omni' }}
run: |
git clone ${{ 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: Sync Device Dependencies (AOSP)
if: ${{ steps.buildtree.outputs.value == 'twrp' }}
run: |
source build/envsetup.sh
lunch ${{ steps.buildtree.outputs.value }}_${{ github.event.inputs.DEVICE_NAME }}-eng
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
id: syncdevicedeps
continue-on-error: true

- name: Sync Device Dependencies (Omni/subdevices)
if: |
steps.buildtree.outputs.value == 'omni'
|| steps.syncdevicedeps.outcome == 'failure'
run: |
bash ${GITHUB_WORKSPACE}/scripts/convert.sh ${{ github.event.inputs.DEVICE_PATH }}/${{ steps.buildtree.outputs.value }}.dependencies
repo sync -j$(nproc --all)
Expand All @@ -142,14 +171,15 @@ jobs:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
swap-size-gb: 24

- name: Repopick Gerrit patches
if: github.event.inputs.REPOPICK_PATCHES != null
run: |
source build/envsetup.sh
repopick ${{ github.event.inputs.REPOPICK_PATCHES }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
continue-on-error: true

- name: Install Python 2
if: ${{ steps.buildtree.outputs.value == 'omni' }}
Expand All @@ -162,7 +192,7 @@ jobs:
run: |
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch ${{ steps.buildtree.outputs.value }}_${{ github.event.inputs.DEVICE_NAME }}-eng && make clean && make ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all)
lunch ${{ steps.buildtree.outputs.value }}_${{ github.event.inputs.DEVICE_NAME }}-eng && make ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all)
working-directory: ${{ steps.pwd.outputs.workspace-folder }}

- name: Upload to Release
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Use Github Action to compile Recovery
```
Support OFRP, SHRP, TWRP compilation and production
Support PBRP, SHRP, TWRP compilation and production
```
---

## Release Notes
```
= 2024/02/11
- Fix support for dependencies in AOSP trees
- Increase swap size for kernel inline builds
- Remove common tree input fields (not needed)
- OrangeFox not presently supported due to script-based sync methods
= 2023/11/28
- Add support to repopick patches from Gerrit
= 2023/10/31
- Fix build with Omni manifests
- 5.1 branch no longer supported
Expand Down Expand Up @@ -51,10 +60,8 @@ Support OFRP, SHRP, TWRP compilation and production
| `DEVICE_TREE_URL` | Device address | https://github.com/TeamWin/android_device_asus_I003D |
| `DEVICE_TREE_BRANCH` | Device branch | android-12.1 |
| `DEVICE_PATH` | Device location | device/asus/I003D |
| `COMMON_TREE_URL` | Common tree address | https://github.com/TeamWin/android_device_asus_sm8250-common |
| `COMMON_PATH` | Common tree location | device/asus/sm8250-common |
| `DEVICE_NAME` | Model name | I003D |
| `MAKEFILE_NAME` | Makefile name | twrp_I003D |
| `REPOPICK_PATCHES` | Gerrit patches to include in build (space separated) | 1245 1437 |
| `BUILD_TARGET` | Build Target Partition (boot/recovery/vendorboot) | recovery |

-----
Expand Down Expand Up @@ -117,5 +124,5 @@ Can be downloaded at [Release](../../releases)
## Remark

#### TeamWin Recovery Project: https://github.com/minimal-manifest-twrp
#### OrangeFox Recovery Project: https://gitlab.com/OrangeFox/Manifest.git
#### SKYHAWK Recovery Project: https://github.com/SHRP/platform_manifest_twrp_omni.git
#### PitchBlack Recovery Project: https://github.com/PitchBlackRecoveryProject/manifest_pb.git
#### SKYHAWK Recovery Project: https://github.com/SHRP/manifest.git
4 changes: 4 additions & 0 deletions templates/roomservice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!--project name="{DEVICE_TREE_URL_REPO}" path="{DEVICE_PATH}" remote="{DEVICE_REMOTE_NAME}" revision="{DEVICE_TREE_BRANCH}"/-->
</manifest>

0 comments on commit 3fdc2e3

Please sign in to comment.