Make_Common.yml 4.6 KB

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