action.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. name: "Rebuild Armbian"
  2. author: "https://github.com/armbian"
  3. description: "Build Armbian Linux"
  4. inputs:
  5. armbian_token:
  6. description: "GitHub installation access token"
  7. required: true
  8. armbian_runner_clean:
  9. description: "Make some space on GH runners"
  10. required: false
  11. default: ""
  12. armbian_artifacts:
  13. descriptions: "Upload PATH"
  14. required: false
  15. default: "build/output/images/"
  16. armbian_target:
  17. description: "Build image or kernel"
  18. required: false
  19. default: "kernel"
  20. armbian_branch:
  21. description: "Choose framework branch"
  22. required: false
  23. default: "main"
  24. armbian_kernel_branch:
  25. description: "Choose kernel branch"
  26. required: false
  27. default: "current"
  28. armbian_release:
  29. description: "Choose userspace release"
  30. required: false
  31. default: "jammy"
  32. armbian_version:
  33. description: "Set different version"
  34. required: false
  35. default: ""
  36. armbian_board:
  37. description: "Select hardware platform"
  38. required: false
  39. default: "uefi-x86"
  40. armbian_ui:
  41. description: "Armbian user interface"
  42. required: false
  43. default: "server"
  44. armbian_compress:
  45. description: "Armbian compress method"
  46. required: false
  47. default: "sha,img,xz"
  48. armbian_extensions:
  49. description: "Armbian lists of extensions"
  50. required: false
  51. default: ""
  52. armbian_userpatches:
  53. description: "Armbian userpatches path"
  54. required: false
  55. default: ""
  56. armbian_pgp_key:
  57. description: "Armbian PGP key"
  58. required: false
  59. default: ""
  60. armbian_pgp_password:
  61. description: "Armbian PGP password"
  62. required: false
  63. default: ""
  64. armbian_release_tittle:
  65. description: "Armbian image"
  66. required: false
  67. default: "Armbian image"
  68. armbian_release_body:
  69. description: "Armbian images"
  70. required: false
  71. default: "Build with [Armbian tools](https://github.com/armbian/build)"
  72. armbian_release_tag:
  73. description: "Armbian release tag"
  74. required: false
  75. runs:
  76. using: "composite"
  77. steps:
  78. - name: Free Github Runner
  79. if: ${{ inputs.armbian_runner_clean != '' }}
  80. uses: descriptinc/free-disk-space@main
  81. with:
  82. android: true
  83. dotnet: true
  84. haskell: true
  85. large-packages: true
  86. docker-images: true
  87. swap-storage: true
  88. - name: "Import GPG key"
  89. if: ${{ inputs.armbian_pgp_key != '' }}
  90. uses: crazy-max/ghaction-import-gpg@v6
  91. with:
  92. gpg_private_key: ${{ inputs.armbian_pgp_key }}
  93. passphrase: ${{ inputs.armbian_pgp_password }}
  94. - name: "Checkout Armbian os"
  95. uses: actions/checkout@v4
  96. with:
  97. repository: armbian/os
  98. fetch-depth: 0
  99. clean: false
  100. path: os
  101. - name: "Checkout Armbian build framework"
  102. uses: actions/checkout@v4
  103. with:
  104. repository: armbian/build
  105. ref: ${{ inputs.armbian_branch }}
  106. clean: false
  107. path: build
  108. - name: "Checkout customisations"
  109. uses: actions/checkout@v4
  110. with:
  111. fetch-depth: 0
  112. clean: false
  113. path: custom
  114. - shell: bash
  115. run: |
  116. # read version from upstream Armbian OS
  117. cat os/stable.json | jq '.version' | sed "s/\"//g" | sed 's/^/ARMBIAN_VERSION=/' >> $GITHUB_ENV
  118. [[ "${{ inputs.armbian_version }}" != '' ]] && echo "ARMBIAN_VERSION=${{ inputs.armbian_version }}" >> $GITHUB_ENV
  119. # copy os userpatches and custom
  120. mkdir -pv build/userpatches
  121. rsync -av os/userpatches/. build/userpatches/
  122. if [[ -d custom/userpatches ]]; then
  123. rsync -av custom/userpatches/. build/userpatches/
  124. fi
  125. - shell: bash
  126. run: |
  127. # userspace decode
  128. if [[ "${{ inputs.armbian_ui }}" == minimal ]]; then
  129. BUILD_DESKTOP="no"
  130. BUILD_MINIMAL="yes"
  131. elif [[ "${{ inputs.armbian_ui }}" == server ]]; then
  132. BUILD_DESKTOP="no"
  133. BUILD_MINIMAL="no"
  134. else
  135. BUILD_DESKTOP="yes"
  136. BUILD_MINIMAL="no"
  137. DESKTOP_ENVIRONMENT="${{ inputs.armbian_ui }}"
  138. DESKTOP_APPGROUPS_SELECTED=""
  139. DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base"
  140. fi
  141. # go to build folder
  142. cd build
  143. # execute build command
  144. ./compile.sh "${{ inputs.armbian_target }}" \
  145. REVISION="${{ env.ARMBIAN_VERSION }}" \
  146. BOARD="${{ inputs.armbian_board }}" \
  147. BRANCH="${{ inputs.armbian_kernel_branch }}" \
  148. RELEASE="${{ inputs.armbian_release }}" \
  149. KERNEL_CONFIGURE="no" \
  150. BUILD_DESKTOP="${BUILD_DESKTOP}" \
  151. BUILD_MINIMAL="${BUILD_MINIMAL}" \
  152. DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \
  153. DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \
  154. DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \
  155. ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \
  156. COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \
  157. SHARE_LOG="yes" \
  158. EXPERT="yes"
  159. - name: Sign
  160. shell: bash
  161. if: ${{ inputs.armbian_pgp_password != '' }}
  162. run: |
  163. echo ${{ inputs.armbian_pgp_password }} | \
  164. gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes \
  165. build/output/images/*.img*.xz
  166. - uses: ncipollo/release-action@v1
  167. with:
  168. tag: ${{ inputs.armbian_release_tag != '' && inputs.armbian_release_tag || env.ARMBIAN_VERSION }}
  169. name: "${{ inputs.armbian_release_tittle }}"
  170. artifacts: "${{ inputs.armbian_artifacts }}*"
  171. allowUpdates: true
  172. removeArtifacts: false
  173. replacesArtifacts: true
  174. makeLatest: true
  175. token: "${{ inputs.armbian_token }}"
  176. body: |
  177. ${{ inputs.armbian_release_body }}
  178. branding:
  179. icon: "check"
  180. color: "red"