android_builds.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. name: 🤖 Android Builds
  2. on:
  3. workflow_call:
  4. # Global Settings
  5. env:
  6. # Used for the cache key. Add version suffix to force clean build.
  7. GODOT_BASE_BRANCH: master
  8. SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
  9. jobs:
  10. build-android:
  11. runs-on: ubuntu-24.04
  12. name: ${{ matrix.name }}
  13. timeout-minutes: 60
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. include:
  18. - name: Editor (target=editor)
  19. cache-name: android-editor
  20. target: editor
  21. tests: false
  22. sconsflags: arch=arm64 production=yes swappy=yes
  23. cache-limit: 1
  24. - name: Template arm32 (target=template_release, arch=arm32)
  25. cache-name: android-template-arm32
  26. target: template_release
  27. tests: false
  28. sconsflags: arch=arm32 swappy=yes
  29. cache-limit: 1
  30. - name: Template arm64 (target=template_release, arch=arm64)
  31. cache-name: android-template-arm64
  32. target: template_release
  33. tests: false
  34. sconsflags: arch=arm64 swappy=yes
  35. cache-limit: 1
  36. steps:
  37. - name: Checkout
  38. uses: actions/checkout@v4
  39. with:
  40. submodules: recursive
  41. - name: Set up Java 17
  42. uses: actions/setup-java@v4
  43. with:
  44. distribution: temurin
  45. java-version: 17
  46. - name: Restore Godot build cache
  47. uses: ./.github/actions/godot-cache-restore
  48. with:
  49. cache-name: ${{ matrix.cache-name }}
  50. continue-on-error: true
  51. - name: Setup Python and SCons
  52. uses: ./.github/actions/godot-deps
  53. - name: Download pre-built Android Swappy Frame Pacing Library
  54. uses: dsaltares/fetch-gh-release-asset@1.1.2
  55. with:
  56. repo: darksylinc/godot-swappy
  57. version: tags/v2023.3.0.0
  58. file: godot-swappy.7z
  59. target: swappy/godot-swappy.7z
  60. - name: Extract pre-built Android Swappy Frame Pacing Library
  61. run: 7za x -y swappy/godot-swappy.7z -o${{github.workspace}}/thirdparty/swappy-frame-pacing
  62. - name: Compilation
  63. uses: ./.github/actions/godot-build
  64. with:
  65. sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
  66. platform: android
  67. target: ${{ matrix.target }}
  68. tests: ${{ matrix.tests }}
  69. scons-cache-limit: ${{ matrix.cache-limit }}
  70. - name: Save Godot build cache
  71. uses: ./.github/actions/godot-cache-save
  72. with:
  73. cache-name: ${{ matrix.cache-name }}
  74. continue-on-error: true
  75. - name: Generate Godot templates
  76. if: matrix.target == 'template_release'
  77. run: |
  78. cd platform/android/java
  79. ./gradlew generateGodotTemplates
  80. cd ../../..
  81. ls -l bin/
  82. - name: Generate Godot editor
  83. if: matrix.target == 'editor'
  84. run: |
  85. cd platform/android/java
  86. ./gradlew generateGodotEditor
  87. ./gradlew generateGodotHorizonOSEditor
  88. ./gradlew generateGodotPicoOSEditor
  89. cd ../../..
  90. ls -l bin/android_editor_builds/
  91. # Separate different editors for multiple artifacts
  92. mkdir horizonos
  93. mv bin/android_editor_builds/*-horizonos-* horizonos
  94. mkdir picoos
  95. mv bin/android_editor_builds/*-picoos-* picoos
  96. - name: Upload artifact
  97. uses: ./.github/actions/upload-artifact
  98. with:
  99. name: ${{ matrix.cache-name }}
  100. - name: Upload artifact (Horizon OS)
  101. if: matrix.target == 'editor'
  102. uses: ./.github/actions/upload-artifact
  103. with:
  104. name: ${{ matrix.cache-name }}-horizonos
  105. path: horizonos
  106. - name: Upload artifact (PICO OS)
  107. if: matrix.target == 'editor'
  108. uses: ./.github/actions/upload-artifact
  109. with:
  110. name: ${{ matrix.cache-name }}-picoos
  111. path: picoos