Make.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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-8.1'
  17. DEVICE_URL:
  18. description: 'DEVICE_URL'
  19. required: true
  20. default: 'https://github.com/OpenWatchProject/twrp_device_mediatek_harmony'
  21. DEVICE_BRANCH:
  22. description: 'DEVICE_BRANCH'
  23. required: true
  24. default: 'android-8.1'
  25. DEVICE_PATH:
  26. description: 'DEVICE_PATH'
  27. required: true
  28. default: 'device/mediatek/harmony'
  29. DEVICE_NAME:
  30. description: 'DEVICE_NAME'
  31. required: true
  32. default: 'harmony'
  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 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
  50. - name: Set variables
  51. run: |
  52. echo "::set-output name=date::$(date +%F)"
  53. id: var
  54. - name: Install repo
  55. run: |
  56. mkdir ~/bin
  57. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  58. chmod a+x ~/bin/repo
  59. export PATH=~/bin:$PATH
  60. - name: Initialize repo
  61. run: |
  62. PATH=~/bin:$PATH
  63. mkdir workspace
  64. cd workspace
  65. echo "::set-output name=pwd::$(pwd)"
  66. git config --global user.name "Hikaru's Action-Build-Bot"
  67. git config --global user.email "Android@teio.tk"
  68. repo init --depth=1 -u ${{ github.event.inputs.LIBRARY_URL }} -b ${{ github.event.inputs.LIBRARY_BRANCH }}
  69. id: pwd
  70. - name: Repo Sync
  71. run: |
  72. PATH=~/bin:$PATH
  73. cd workspace
  74. repo sync -j$(nproc --all) -f --force-sync
  75. - name: Clone device
  76. run: |
  77. PATH=~/bin:$PATH
  78. cd ${{ steps.pwd.outputs.pwd }}
  79. git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
  80. - name: Building
  81. run: |
  82. PATH=~/bin:$PATH
  83. cd ${{ steps.pwd.outputs.pwd }}
  84. export ALLOW_MISSING_DEPENDENCIES=true
  85. source build/envsetup.sh
  86. lunch ${{ github.event.inputs.LIBRARY_NAME }}_${{ github.event.inputs.DEVICE_NAME }}-eng
  87. make clean
  88. make recoveryimage -j$(nproc --all)
  89. - name: Upload to Release
  90. uses: softprops/action-gh-release@v1
  91. with:
  92. files: |
  93. workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
  94. workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/recovery.img
  95. name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
  96. tag_name: ${{ github.run_id }}
  97. body: Recovery for ${{ github.event.inputs.DEVICE_NAME }}
  98. env:
  99. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}