diff --git a/.github/workflows/OrangeFox-Compile.yml b/.github/workflows/OrangeFox-Compile.yml index 112997e..294d986 100644 --- a/.github/workflows/OrangeFox-Compile.yml +++ b/.github/workflows/OrangeFox-Compile.yml @@ -19,7 +19,7 @@ on: MANIFEST_BRANCH: description: 'OrangeFox Branch' required: true - default: '10' # Branch 11 and 12.1's lunch command doesn't work using this action builder. + default: '10' type: choice options: - 12.1 @@ -58,23 +58,21 @@ on: jobs: build: - if: github.event.repository.owner.id == github.event.sender.id + name: Build Kernel by ${{ github.actor }} runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} permissions: contents: write steps: - - name: Check Out - uses: actions/checkout@v3.1.0 - - - name: Set Current Date # For Build Date Info, currently using Asia/Manila - id: today - run: | - echo "date=$(TZ=Asia/Manila date +%Y%m%d-%l:%M%p)" >> $GITHUB_OUTPUT - - - name: Cleanup + - name: Checkout + uses: actions/checkout@v3 + + - name: Clean-up uses: rokibhasansagar/slimhub_actions@main - - name: Set Swap Space + - name: Swap Space uses: pierotofy/set-swap-space@master with: swap-size-gb: 12 @@ -107,6 +105,14 @@ jobs: cd fox_${{ github.event.inputs.MANIFEST_BRANCH }} git clone ${{ github.event.inputs.DEVICE_TREE }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }} working-directory: ${{ steps.pwd.outputs.workdir }} + + - name: Check Manifest Branch + uses: haya14busa/action-cond@v1 + id: fox_branch + with: + cond: ${{ github.event.inputs.MANIFEST_BRANCH == '11.0' || github.event.inputs.MANIFEST_BRANCH == '12.1' }} + if_true: lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image + if_false: lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && mka ${{ github.event.inputs.BUILD_TARGET }}image - name: Building OrangeFox run: | @@ -115,8 +121,13 @@ jobs: source build/envsetup.sh export ALLOW_MISSING_DEPENDENCIES=true set -e - + ${{ steps.fox_branch.outputs.value }} working-directory: ${{ steps.pwd.outputs.workdir }} + + - name: Set Current Date # For Build Date Info, currently using Asia/Manila + id: today + run: | + echo "date=$(TZ=Asia/Manila date +%Y%m%d-%l:%M%p)" >> $GITHUB_OUTPUT - name: Upload to Release uses: softprops/action-gh-release@v1 @@ -129,6 +140,4 @@ jobs: body: | Build: fox_${{ github.event.inputs.MANIFEST_BRANCH }} - ${{ steps.today.outputs.date }} Device: ${{ github.event.inputs.DEVICE_TREE }}/tree/${{ github.event.inputs.DEVICE_TREE_BRANCH }} - Manifest: ${{ github.event.inputs.MANIFEST_URL }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Manifest: ${{ github.event.inputs.MANIFEST_URL }} \ No newline at end of file diff --git a/.github/workflows/OrangeFox-Testing.yml b/.github/workflows/OrangeFox-Testing.yml deleted file mode 100644 index 8096894..0000000 --- a/.github/workflows/OrangeFox-Testing.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: Testing - -on: - workflow_dispatch: - inputs: - MANIFEST_URL: - description: 'Manifest' - required: true - default: '' - type: choice - options: - - https://gitlab.com/OrangeFox/sync.git - MANIFEST_BRANCH: - description: 'OrangeFox Branch' - required: true - default: '12.1' - type: choice - options: - - 12.1 - - 11.0 - - 10.0 - - 9.0 - DEVICE_TREE: - description: 'Custom Recovery Tree' - required: true - default: 'https://github.com/cd-Spidey/custom_recovery_tree_xiaomi_cannong' - DEVICE_TREE_BRANCH: - description: 'Custom Recovery Tree Branch' - required: true - default: 'fox_12.1' - DEVICE_PATH: - description: 'Specify your device path.' - required: true - default: 'device/xiaomi/cannong' - DEVICE_NAME: - description: 'Specify your Device Codename.' - required: true - default: 'cannong' - MAKEFILE_NAME: - description: 'Specify your twrp/omni_codename' - required: true - default: 'twrp_cannong' - BUILD_TARGET: - description: 'Specify your Build Target' - required: true - default: 'recovery' - type: choice - options: - - boot - - recovery - - vendor_boot - -jobs: - build: - if: github.event.repository.owner.id == github.event.sender.id - runs-on: ubuntu-20.04 - steps: - - name: Check Out - uses: actions/checkout@v2.5.0 - - - name: Cleanup - uses: rokibhasansagar/slimhub_actions@main - - - name: Set Swap Space - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 10 - - - name: Build Environment - run: | - sudo apt install aria2 -y - git clone https://github.com/cd-Spidey/Random.git ./buildenv - sudo bash buildenv/setup/packages/build_env.sh - - - name: Install OpenJDK - uses: actions/setup-java@v3.6.0 - with: - distribution: 'zulu' - java-version: '17' - - - name: Install Git-Repo - run: | - git config --global advice.detachedHead false - git clone https://android.googlesource.com/tools/repo -b v2.29 ~/bin - chmod a+x ~/bin/repo - sudo ln -sf ~/bin/repo /usr/bin/repo - - - name: Set-up Manifest - run: | - mkdir ~/orangefoxtemp - cd ~/orangefoxtemp - git clone https://gitlab.com/OrangeFox/sync.git - cd sync - ./orangefox_sync.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path ~/fox_${{ github.event.inputs.MANIFEST_BRANCH }} - - - - name: Clone Device Tree - run: | - cd ~/fox_${{ github.event.inputs.MANIFEST_BRANCH }} - git config --global user.name "Carlo Dandan" - git config --global user.email "jasminecarlo01@gmail.com" - git clone ${{ github.event.inputs.DEVICE_TREE }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }} - - - name: Check Manifest Branch - uses: haya14busa/action-cond@v1 - id: fox_branch - with: - cond: ${{ github.event.inputs.MANIFEST_BRANCH == '11.0' || github.event.inputs.MANIFEST_BRANCH == '12.1' }} - if_true: lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image - if_false: lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && mka ${{ github.event.inputs.BUILD_TARGET }}image - - - name: Building Custom Recovery - run: | - cd ~/fox_${{ github.event.inputs.MANIFEST_BRANCH }} - source build/envsetup.sh - ${{ steps.fox_branch.outputs.value }} - echo "Done..." - working-directory: ${{ steps.pwd.outputs.workdir }} - - - name: Upload to Release - uses: softprops/action-gh-release@v1 - with: - files: | - OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.img - OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/OrangeFox*.zip - name: Unofficial OrangeFox for ${{ github.event.inputs.DEVICE_NAME }} - tag_name: ${{ github.run_id }} - body: | - Manifest: ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} - Device: unofficial-fox_${{ github.event.inputs.MANIFEST_BRANCH }}-${{ github.event.inputs.DEVICE_NAME }}.img - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}