Make.yml 3.9 KB

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