Make.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. name: Normal
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. MANIFEST_URL:
  6. description: 'MANIFEST_URL'
  7. required: true
  8. default: 'git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git'
  9. MANIFEST_BRANCH:
  10. description: 'LIBRARY_BRANCH'
  11. required: true
  12. default: 'twrp-9.0'
  13. DEVICE_TREE_URL:
  14. description: 'DEVICE_TREE_URL'
  15. required: true
  16. default: 'https://github.com/azwhikaru/twrp_device_xiaomi_archytas'
  17. DEVICE_TREE_BRANCH:
  18. description: 'DEVICE_TREE_BRANCH'
  19. required: true
  20. default: 'twrp-9.0'
  21. DEVICE_PATH:
  22. description: 'DEVICE_PATH'
  23. required: true
  24. default: 'device/xiaomi/Archytas'
  25. DEVICE_NAME:
  26. description: 'DEVICE_NAME'
  27. required: true
  28. default: 'Archytas'
  29. MAKEFILE_NAME:
  30. description: 'MAKEFILE_NAME'
  31. required: true
  32. default: 'omni_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.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }}
  70. id: pwd
  71. - name: Repo Sync
  72. run: |
  73. PATH=~/bin:$PATH
  74. cd workspace
  75. repo sync -j$(nproc --all) -c --no-clone-bundle --no-tags
  76. rm -rf .repo
  77. - name: Clone device tree
  78. run: |
  79. PATH=~/bin:$PATH
  80. cd ${{ steps.pwd.outputs.pwd }}
  81. git clone ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
  82. - name: Set Swap Space
  83. uses: pierotofy/set-swap-space@master
  84. with:
  85. swap-size-gb: 10
  86. - name: Building recovery
  87. run: |
  88. PATH=~/bin:$PATH
  89. cd ${{ steps.pwd.outputs.pwd }}
  90. export ALLOW_MISSING_DEPENDENCIES=true
  91. source build/envsetup.sh
  92. lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng
  93. make clean
  94. make recoveryimage -j$(nproc --all)
  95. - name: Upload to Release
  96. uses: softprops/action-gh-release@v1
  97. with:
  98. files: 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 }}