Make.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. name: Make Recovery
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. LIBRARY_NAME:
  6. description: 'LIBRARY_NAME'
  7. required: true
  8. default: 'omni'
  9. LIBRARY_URL:
  10. description: 'LIBRARY_URL'
  11. required: true
  12. default: 'https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git'
  13. LIBRARY_BRANCH:
  14. description: 'LIBRARY_BRANCH'
  15. required: true
  16. default: 'twrp-10.0'
  17. DEVICE_URL:
  18. description: 'DEVICE_URL'
  19. required: true
  20. default: 'https://github.com/Xpsoted/android_device_qualcomm_qrd855-TWRP'
  21. DEVICE_BRANCH:
  22. description: 'DEVICE_BRANCH'
  23. required: true
  24. default: 'android-10'
  25. DEVICE_PATH:
  26. description: 'DEVICE_PATH'
  27. required: true
  28. default: 'device/qualcomm/msmnile'
  29. DEVICE_NAME:
  30. description: 'DEVICE_NAME'
  31. required: true
  32. default: 'msmnile'
  33. DEVICE_TYPE:
  34. description: 'DEVICE_TYPE'
  35. required: true
  36. default: 'eng'
  37. jobs:
  38. build:
  39. if: github.event.repository.owner.id == github.event.sender.id
  40. runs-on: ubuntu-18.04
  41. steps:
  42. - name: Check Out
  43. uses: actions/checkout@main
  44. - name: Prepare the environment
  45. run: |
  46. docker rmi `docker images -q`
  47. sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
  48. sudo apt -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
  49. sudo apt -y autoremove --purge
  50. sudo apt -y autoclean
  51. sudo apt clean
  52. sudo apt update
  53. sudo apt -y install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip jq bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev imagemagick libbz2-dev libssl-dev lzma ncftp bash-completion python openjdk-8-jdk qemu-user-static
  54. - name: Set variables
  55. run: |
  56. echo "::set-output name=date::$(date +%F)"
  57. id: var
  58. - name: Install repo
  59. run: |
  60. mkdir ~/bin
  61. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  62. chmod a+x ~/bin/repo
  63. export PATH=~/bin:$PATH
  64. - name: Initialize repo
  65. run: |
  66. PATH=~/bin:$PATH
  67. mkdir workspace
  68. cd workspace
  69. echo "::set-output name=pwd::$(pwd)"
  70. git config --global user.name "Hikaru's Action-Build-Bot"
  71. git config --global user.email "Android@teio.tk"
  72. repo init --depth=1 -u ${{ github.event.inputs.LIBRARY_URL }} -b ${{ github.event.inputs.LIBRARY_BRANCH }}
  73. id: pwd
  74. - name: Repo Sync
  75. run: |
  76. PATH=~/bin:$PATH
  77. cd workspace
  78. repo sync -j$(nproc --all)
  79. - name: Clone device
  80. run: |
  81. PATH=~/bin:$PATH
  82. cd ${{ steps.pwd.outputs.pwd }}
  83. git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
  84. - name: Building
  85. run: |
  86. PATH=~/bin:$PATH
  87. cd ${{ steps.pwd.outputs.pwd }}
  88. export ALLOW_MISSING_DEPENDENCIES=true
  89. source build/envsetup.sh
  90. lunch ${{ github.event.inputs.LIBRARY_NAME }}_${{ github.event.inputs.DEVICE_NAME }}-${{ github.event.inputs.DEVICE_TYPE }}
  91. make clean
  92. make recoveryimage -j$(nproc --all)
  93. - name: Upload to Release
  94. uses: softprops/action-gh-release@v1
  95. with:
  96. files: |
  97. workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
  98. workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery.img
  99. name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
  100. tag_name: ${{ github.run_id }}
  101. body: Recovery for ${{ github.event.inputs.DEVICE_NAME }}
  102. env:
  103. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}