├── .gitattributes ├── README_CN.md ├── README.md └── .github └── workflows └── Recovery Build.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # 使用 Action 编译 Recovery 2 | 3 | - 支持 OrangeFox, TWRP 及其它衍生版本请使用 [Action-TWRP-Builder](https://github.com/azwhikaru/Action-TWRP-Builder) 4 | 5 | --- 6 | 7 | ## 致谢 8 | - 所有贡献者 9 | 10 | --- 11 | 12 | ## 更新说明 13 | ``` 14 | = 2023/04/20 15 | - 提交第一个可用版本 16 | ``` 17 | 18 | ----- 19 | 20 | ## 参数说明 21 | 22 | | 参数 | 描述 | 示例 | 23 | | ------------ | -------------------- | ------------ | 24 | | `SYNC_URL` | OrangeFox 提供的同步脚本 | https://gitlab.com/OrangeFox/sync.git | 25 | | `MANIFEST_BRANCH` | 源码分支 | 12.1 | 26 | | `DEVICE_TREE_URL` | Device tree URL | https://github.com/OrangeFoxRecovery/device_xiaomi_laurel_sprout | 27 | | `DEVICE_TREE_BRANCH` | Device tree 分支 | fox_12.1 | 28 | | `DEVICE_PATH` | Device tree 位置 | device/xiaomi/laurel_sprout | 29 | | `COMMON_TREE_URL` | Common tree URL | | 30 | | `COMMON_PATH` | Common tree 位置 | | 31 | | `DEVICE_NAME` | 机型 | laurel_sprout | 32 | | `MAKEFILE_NAME` | Makefile 名称 | twrp_laurel_sprout | 33 | | `BUILD_TARGET` | 编译目标(boot/recovery/vendorboot) | recovery | 34 | 35 | ----- 36 | 37 | ## 如何使用 38 | ``` 39 | 例如你的 Github 用户名是 "JohnSmith" 40 | ``` 41 | #### 1. 点击当前仓库右上角的 "Fork" 按钮 42 | ![image](https://user-images.githubusercontent.com/37921907/177914706-c92476c5-7e14-4fb3-be94-0c8a11dae874.png) 43 | #### 2. 等待自动重定向后,你将会看到你的用户名 44 | ![image](https://user-images.githubusercontent.com/37921907/177915106-5bde6fc9-303c-479e-b290-22b48efd1e4e.png) 45 | ----- 46 | 47 | ## 开始编译 Recovery 48 | #### 9. 进入 "Actions-Recovery Build" 49 | ![image](https://user-images.githubusercontent.com/37921907/177915304-8731ed80-1d49-48c9-9848-70d0ac8f2720.png) 50 | #### 10. 点击 "Run workflow" 并按照参数说明内的描述填写参数 51 | ![image](https://user-images.githubusercontent.com/37921907/177915346-71c29149-78fb-4a00-996f-5d84ffc9eb8c.png) 52 | #### 11. 填写完毕后, 点击 "Run workflow" 开始运行 53 | 54 | ----- 55 | 56 | ## 编译结果 57 | 可以在 [Release](../../releases) 下载 58 | 59 | 文件没有被上传到 Release?请检查步骤 "Check the output directory before uploading" 并检查文件名 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build Recovery using Github Actions 2 | 3 | - Support OrangeFox, [TWRP](https://github.com/azwhikaru/Action-TWRP-Builder) is here 4 | - [中文说明](./README_CN.md) 5 | 6 | --- 7 | 8 | ## Thanks to 9 | - All contributors 10 | 11 | --- 12 | 13 | ## Release Notes 14 | ``` 15 | = 2023/04/20 16 | - The first available version is submitted. 17 | ``` 18 | 19 | ----- 20 | 21 | ## Parameter Description 22 | 23 | | Name | Description | Example | 24 | | ------------ | -------------------- | ------------ | 25 | | `SYNC_URL` | Script specified by OrangeFox | https://gitlab.com/OrangeFox/sync.git | 26 | | `MANIFEST_BRANCH` | Source branch | 12.1 | 27 | | `DEVICE_TREE_URL` | Device address | https://github.com/OrangeFoxRecovery/device_xiaomi_laurel_sprout | 28 | | `DEVICE_TREE_BRANCH` | Device branch | fox_12.1 | 29 | | `DEVICE_PATH` | Device location | device/xiaomi/laurel_sprout | 30 | | `COMMON_TREE_URL` | Common tree address | | 31 | | `COMMON_PATH` | Common tree location | | 32 | | `DEVICE_NAME` | Model name | laurel_sprout | 33 | | `MAKEFILE_NAME` | Makefile name | twrp_laurel_sprout | 34 | | `BUILD_TARGET` | Build Target Partition (boot/recovery/vendorboot) | recovery | 35 | 36 | ----- 37 | 38 | ## How to use 39 | ``` 40 | For example, your username is: JohnSmith 41 | ``` 42 | #### 1. Click 'Fork' in the upper right corner of this repository 43 | ![image](https://user-images.githubusercontent.com/37921907/177914706-c92476c5-7e14-4fb3-be94-0c8a11dae874.png) 44 | #### 2. After waiting for the automatic redirection, you will see your own username 45 | ![image](https://user-images.githubusercontent.com/37921907/177915106-5bde6fc9-303c-479e-b290-22b48efd1e4e.png) 46 | ----- 47 | 48 | ## Building the Recovery 49 | #### 9. Click 'Actions-Recovery Build' 50 | ![image](https://user-images.githubusercontent.com/37921907/177915304-8731ed80-1d49-48c9-9848-70d0ac8f2720.png) 51 | #### 10. Click 'Run workflow' and fill in according to the above 'parameter description' 52 | ![image](https://user-images.githubusercontent.com/37921907/177915346-71c29149-78fb-4a00-996f-5d84ffc9eb8c.png) 53 | #### 11. After filling in, click 'Run workflow' to start running 54 | 55 | ----- 56 | 57 | ## Compilation results 58 | Can be downloaded at [Release](../../releases) 59 | 60 | File not being uploaded to Release? Please check the step 'Check the output directory before uploading' and check the file name -------------------------------------------------------------------------------- /.github/workflows/Recovery Build.yml: -------------------------------------------------------------------------------- 1 | name: Recovery Build 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | SYNC_URL: 7 | description: 'SYNC_URL' 8 | required: true 9 | default: 'https://gitlab.com/OrangeFox/sync.git' 10 | MANIFEST_BRANCH: 11 | description: 'MANIFEST_BRANCH' 12 | required: true 13 | default: '11.0' 14 | DEVICE_TREE_URL: 15 | description: 'DEVICE_TREE_URL' 16 | required: true 17 | default: 'https://github.com/OrangeFoxRecovery/device_xiaomi_garden' 18 | DEVICE_TREE_BRANCH: 19 | description: 'DEVICE_TREE_BRANCH' 20 | required: true 21 | default: 'fox_11.0_Q' 22 | DEVICE_PATH: 23 | description: 'DEVICE_PATH' 24 | required: true 25 | default: 'device/xiaomi/garden' 26 | COMMON_TREE_URL: 27 | description: 'COMMON_TREE_URL (if no common tree, leave blank)' 28 | required: false 29 | COMMON_PATH: 30 | description: 'COMMON_PATH (if no common tree, leave blank)' 31 | required: false 32 | DEVICE_NAME: 33 | description: 'DEVICE_NAME' 34 | required: true 35 | default: 'garden' 36 | MAKEFILE_NAME: 37 | description: 'MAKEFILE_NAME' 38 | required: true 39 | default: 'twrp_garden' 40 | BUILD_TARGET: 41 | description: 'BUILD_TARGET' 42 | required: true 43 | default: 'recovery' 44 | 45 | jobs: 46 | build: 47 | if: github.event.repository.owner.id == github.event.sender.id 48 | runs-on: ubuntu-24.04 49 | permissions: 50 | contents: write 51 | steps: 52 | 53 | # You might want to Checkout your repo first, but not mandatory 54 | - name: Check Out 55 | uses: actions/checkout@v4 56 | 57 | # Cleanup The Actions Workspace Using Custom Composite Run Actions 58 | - name: Cleanup 59 | uses: rokibhasansagar/slimhub_actions@main 60 | 61 | - name: Initialize workspace 62 | run: | 63 | mkdir workspace 64 | cd workspace 65 | echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT 66 | id: pwd 67 | 68 | - name: Prepare the build environment 69 | run: | 70 | sudo apt update && sudo apt upgrade -y 71 | DEBIAN_FRONTEND=noninteractive sudo apt install -yq \ 72 | linux-modules-extra-$(uname -r) \ 73 | git python3 tar aria2 74 | git clone https://gitlab.com/OrangeFox/misc/scripts 75 | cd scripts 76 | sudo bash setup/android_build_env.sh 77 | sed -i 's/cd -/cd ../g' setup/install_android_sdk.sh 78 | sudo bash setup/install_android_sdk.sh 79 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 80 | 81 | - name: Install OpenJDK 82 | uses: actions/setup-java@v4 83 | with: 84 | distribution: 'zulu' 85 | java-version: '11' 86 | 87 | - name: Setup SSH Keys 88 | if: ${{ startsWith(github.event.inputs.MANIFEST_URL, 'git@github.com') || 89 | startsWith(github.event.inputs.DEVICE_TREE_URL, 'git@github.com') || 90 | startsWith(github.event.inputs.COMMON_TREE_URL, 'git@github.com') }} 91 | uses: webfactory/ssh-agent@v0.9.0 92 | with: 93 | ssh-private-key: | 94 | ${{ secrets.SSH_PRIVATE_KEY }} 95 | 96 | - name: Sync OrangeFox sources and minimal manifest 97 | run: | 98 | cd ${{ steps.pwd.outputs.workspace-folder }} 99 | git clone ${{ github.event.inputs.SYNC_URL }} 100 | cd sync 101 | ./orangefox_sync.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }} 102 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 103 | 104 | - name: Clone device tree 105 | run: | 106 | cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }} 107 | git clone ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }} 108 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 109 | 110 | - name: Clone common tree 111 | if: | 112 | github.event.inputs.COMMON_TREE_URL != null 113 | && github.event.inputs.COMMON_PATH != null 114 | run: | 115 | cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }} 116 | git clone ${{ github.event.inputs.COMMON_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.COMMON_PATH }} 117 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 118 | 119 | - name: Set Swap Space 120 | uses: pierotofy/set-swap-space@master 121 | with: 122 | swap-size-gb: 12 123 | 124 | - name: Building recovery 125 | run: | 126 | cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }} 127 | set +e 128 | source build/envsetup.sh 129 | export ALLOW_MISSING_DEPENDENCIES=true 130 | set -e 131 | lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all) 132 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 133 | continue-on-error: true 134 | 135 | - name: Check the output directory before uploading 136 | run: | 137 | ls -al ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/ 138 | echo 139 | ls -al ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/ 140 | 141 | - name: Upload to Release 142 | uses: softprops/action-gh-release@v2 143 | with: 144 | files: | 145 | ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.img 146 | ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip 147 | name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }} 148 | tag_name: ${{ github.run_id }} 149 | body: | 150 | Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }} 151 | Device: ${{ github.event.inputs.DEVICE_NAME }} 152 | Target: ${{ github.event.inputs.BUILD_TARGET }} 153 | env: 154 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 155 | --------------------------------------------------------------------------------