build.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. name: TWRP
  2. on:
  3. push:
  4. branches:
  5. - 'twrp-12.1'
  6. paths:
  7. - 'version.mk'
  8. jobs:
  9. build:
  10. name: Build TWRP by ${{ github.actor }}
  11. runs-on: ubuntu-20.04
  12. if: github.event.repository.owner.id == github.event.sender.id
  13. permissions:
  14. contents: write
  15. steps:
  16. - name: Check Out
  17. uses: actions/checkout@v3
  18. - name: Cleanup
  19. uses: rokibhasansagar/slimhub_actions@main
  20. - name: Set Swap Space
  21. uses: pierotofy/set-swap-space@master
  22. with:
  23. swap-size-gb: 12
  24. - name: Prepare the environment
  25. run: |
  26. sudo apt update
  27. sudo apt -y upgrade
  28. sudo apt -y install gperf gcc-multilib gcc-10-multilib g++-multilib g++-10-multilib libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc bc ccache lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-gtk3-dev libxml2 lzop pngcrush schedtool squashfs-tools imagemagick libbz2-dev lzma ncftp qemu-user-static libstdc++-10-dev libtinfo5 libgflags-dev
  29. sudo add-apt-repository universe
  30. sudo apt -y install libncurses5
  31. - name: Install OpenJDK
  32. uses: actions/setup-java@v3
  33. with:
  34. distribution: 'zulu'
  35. java-version: '8'
  36. - name: Install Git-Repo
  37. run: |
  38. mkdir ~/bin
  39. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  40. chmod a+x ~/bin/repo
  41. sudo ln -sf ~/bin/repo /usr/bin/repo
  42. - name: Initialize Repo
  43. run: |
  44. mkdir twrp
  45. cd twrp
  46. git config --global user.name "Carlo Dee"
  47. git config --global user.email "carlodee.official@proton.me"
  48. repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
  49. repo sync -j$(nproc --all) --force-sync
  50. - name: Clone Device Tree
  51. run: |
  52. cd twrp
  53. git clone https://github.com/cd-Crypton/custom_recovery_tree_nokia_cap_sprout.git -b twrp-12.1 ./device/nokia/cap_sprout
  54. cd device/nokia/cap_sprout
  55. echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
  56. echo "VERSION=$(cat version.mk | grep '^TW_DEVICE_VERSION' | awk '{print $3}')" >> $GITHUB_ENV
  57. - name: Building Image
  58. run: |
  59. cd twrp
  60. source build/envsetup.sh
  61. export ALLOW_MISSING_DEPENDENCIES=true
  62. lunch twrp_cap_sprout-eng && make clean && make recoveryimage -j$(nproc --all)
  63. cd out/target/product/cap_sprout
  64. mv recovery.img twrp-3.7.0_12-cap_sprout-${{ env.VERSION }}.img
  65. echo "Done building your twrp-3.7.0_12-cap_sprout-${{ env.VERSION }}.img"
  66. - name: Set Properties
  67. run: |
  68. echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
  69. echo -e \
  70. "
  71. ## Unofficial Build for Nokia 5.3 (CAP_sprout)
  72. _Note: Flash at your own risk. This build were still in the process of testing._
  73. ### Resources
  74. * [TWRP Manifest](https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp/tree/twrp-12.1)
  75. * [Device Tree](https://github.com/cd-Crypton/custom_recovery_tree_nokia_cap_sprout/tree/twrp-12.1)
  76. Build Device: CAP_sprout
  77. Build Date: 12/25/2023
  78. Build Release: Unofficial Beta
  79. Build Branch: 12.1 (v3.7.0)
  80. Compatibility: Android 12+
  81. Custom Version: ${{ env.VERSION }}
  82. ### Features
  83. * [What's working?](https://github.com/cd-Crypton/custom_recovery_tree_nokia_cap_sprout/tree/twrp-12.1?tab=readme-ov-file#features)
  84. ### Issues and Bugs
  85. * Flashing OTA firmware file, it was not tested.
  86. * FastbootD mode weren't fully tested.
  87. * Flashing ZIPs weren't fully tested.
  88. * Tell me more...
  89. ### How to flash?
  90. Despite having A/B Partition Scheme, it has dedicated recovery ramdisk. You can install without using the usual A/B installation process.
  91. Now, assuming you already have unlocked bootloader, your PC has adb/fastboot installed, and platform tools. Let's begin.
  92. Note: Flash at your own risk.
  93. 1. Download the .img file from the release page.
  94. 2. Place the image file inside platform tools folder in your PC.
  95. 3. Now, open CMD inside platform tools folder.
  96. 4. Boot your device in bootloader/fastboot mode.
  97. 5. Type in CMD: `fastboot flash recovery name-of-twrp.img`. It'll flash in current active slot.
  98. 6. After flashing is done, type: `fastboot reboot recovery`.
  99. 7. Enjoy your new custom recovery—TWRP.
  100. ### Credits
  101. * Team Win (for Manifest/Source)
  102. * SebaUbuntu (for base device tree)
  103. ### What's new?
  104. * Initial build.
  105. * Sync with latest changes in source/manifest.
  106. ### Trigger Event
  107. _This build were compiled by triggering branch twrp-12.1 of current tree, triggered by a push event in [version makefile](https://github.com/cd-Crypton/custom_recovery_tree_nokia_cap_sprout/blob/twrp-12.1/version.mk)._
  108. * [Last Commit](https://github.com/cd-Crypton/custom_recovery_tree_nokia_cap_sprout/commit/${{ env.COMMIT_ID }})
  109. " > changelog.txt
  110. - name: Upload to Release
  111. uses: softprops/action-gh-release@v1
  112. with:
  113. files: |
  114. twrp/out/target/product/cap_sprout/twrp-3.7.0_12-cap_sprout-${{ env.VERSION }}.img
  115. name: TWRP Release Build for Nokia 5.3 (CAP_sprout) // ${{ env.BUILD_DATE }}
  116. tag_name: ${{ github.run_id }}
  117. body_path: changelog.txt
  118. token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
  119. repository: cd-Crypton/custom-recovery-releases