Make.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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: 'git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git'
  13. LIBRARY_BRANCH:
  14. description: 'LIBRARY_BRANCH'
  15. required: true
  16. default: 'twrp-9.0'
  17. DEVICE_URL:
  18. description: 'DEVICE_URL'
  19. required: true
  20. default: 'https://github.com/azwhikaru/twrp_device_xiaomi_archytas'
  21. DEVICE_BRANCH:
  22. description: 'DEVICE_BRANCH'
  23. required: true
  24. default: 'twrp-9.0'
  25. DEVICE_PATH:
  26. description: 'DEVICE_PATH'
  27. required: true
  28. default: 'device/xiaomi/Archytas'
  29. DEVICE_NAME:
  30. description: 'DEVICE_NAME'
  31. required: true
  32. default: 'Archytas'
  33. jobs:
  34. build:
  35. if: github.event.repository.owner.id == github.event.sender.id
  36. runs-on: ubuntu-18.04
  37. steps:
  38. - name: Check Out
  39. uses: actions/checkout@main
  40. - name: Prepare the environment
  41. run: |
  42. docker rmi `docker images -q`
  43. sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
  44. sudo apt -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
  45. sudo apt -y autoremove --purge
  46. sudo apt -y autoclean
  47. sudo apt clean
  48. sudo apt update
  49. sudo apt -y upgrade
  50. 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
  51. - name: Set variables
  52. run: |
  53. echo "::set-output name=date::$(date +%F)"
  54. id: var
  55. - name: Install repo
  56. run: |
  57. mkdir ~/bin
  58. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  59. chmod a+x ~/bin/repo
  60. export PATH=~/bin:$PATH
  61. - name: Initialize repo
  62. run: |
  63. PATH=~/bin:$PATH
  64. mkdir workspace
  65. cd workspace
  66. echo "::set-output name=pwd::$(pwd)"
  67. git config --global user.name "Hikaru's Action-Build-Bot"
  68. git config --global user.email "Android@teio.tk"
  69. repo init --depth=1 -u ${{ github.event.inputs.LIBRARY_URL }} -b ${{ github.event.inputs.LIBRARY_BRANCH }}
  70. id: pwd
  71. - name: Repo Sync
  72. run: |
  73. PATH=~/bin:$PATH
  74. cd workspace
  75. repo sync -j$(nproc --all) -f --force-sync
  76. ls -al
  77. - name: Clone device
  78. run: |
  79. PATH=~/bin:$PATH
  80. cd ${{ steps.pwd.outputs.pwd }}
  81. git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
  82. - name: Building
  83. run: |
  84. PATH=~/bin:$PATH
  85. cd ${{ steps.pwd.outputs.pwd }}
  86. export ALLOW_MISSING_DEPENDENCIES=true
  87. source build/envsetup.sh
  88. lunch ${{ github.event.inputs.LIBRARY_NAME }}_${{ github.event.inputs.DEVICE_NAME }}-eng
  89. make clean
  90. make recoveryimage -j$(nproc --all)
  91. - name: Compressed file
  92. run: |
  93. PATH=~/bin:$PATH
  94. cd workspace
  95. zip ./${{ github.event.inputs.DEVICE_NAME }}-Built.zip ./out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
  96. zip -m ./${{ github.event.inputs.DEVICE_NAME }}-Built.zip ./out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.img
  97. - name: Upload to Release
  98. uses: softprops/action-gh-release@v1
  99. with:
  100. files: workspace/${{ github.event.inputs.DEVICE_NAME }}-Built.zip
  101. name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
  102. tag_name: ${{ github.run_id }}
  103. body: Recovery for ${{ github.event.inputs.DEVICE_NAME }}
  104. env:
  105. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}