android_builds.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: 🤖 Android Builds
  2. on:
  3. workflow_call:
  4. # Global Settings
  5. env:
  6. # Only used for the cache key. Increment version to force clean build.
  7. GODOT_BASE_BRANCH: 3.2
  8. SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no
  9. ANDROID_HOME: /home/runner/work/godot/godot/android-sdk
  10. ANDROID_NDK_ROOT: /home/runner/work/godot/godot/android-sdk/ndk/21.1.6352462
  11. ANDROID_NDK_VERSION: 21.1.6352462
  12. concurrency:
  13. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-android
  14. cancel-in-progress: true
  15. jobs:
  16. android-template:
  17. runs-on: "ubuntu-20.04"
  18. name: Template (target=release, tools=no)
  19. steps:
  20. - uses: actions/checkout@v4
  21. - name: Set up Java 8, Android SDK and NDK
  22. run: |
  23. # Not using actions/setup-java and android-actions/setup-android as I couldn't make them work for such old Java/SDK/NDK combination.
  24. # Azure repositories are flaky, remove them.
  25. sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
  26. sudo apt-get update
  27. sudo apt-get install openjdk-8-jdk
  28. sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
  29. mkdir -p ${{env.ANDROID_HOME}}
  30. cd ${{env.ANDROID_HOME}}
  31. # Using an old version to be compatible with older Java.
  32. curl -LO https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
  33. unzip commandlinetools-linux-8512546_latest.zip
  34. yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${{env.ANDROID_HOME}} --licenses
  35. # https://github.com/godotengine/build-containers/blob/3.2/Dockerfile.android
  36. ./cmdline-tools/bin/sdkmanager --sdk_root=${{env.ANDROID_HOME}} 'build-tools;28.0.3' 'platforms;android-28' 'cmake;3.10.2.4988404' 'ndk;${{env.ANDROID_NDK_VERSION}}'
  37. - name: Restore Godot build cache
  38. uses: ./.github/actions/godot-cache-restore
  39. continue-on-error: true
  40. - name: Setup python and scons
  41. uses: ./.github/actions/godot-deps
  42. - name: Compilation (armv7)
  43. uses: ./.github/actions/godot-build
  44. with:
  45. sconsflags: ${{ env.SCONSFLAGS }} android_arch=armv7
  46. platform: android
  47. target: release
  48. tools: false
  49. - name: Compilation (arm64v8)
  50. uses: ./.github/actions/godot-build
  51. with:
  52. sconsflags: ${{ env.SCONSFLAGS }} android_arch=arm64v8
  53. platform: android
  54. target: release
  55. tools: false
  56. - name: Save Godot build cache
  57. uses: ./.github/actions/godot-cache-save
  58. continue-on-error: true
  59. - name: Generate Godot templates
  60. run: |
  61. cd platform/android/java
  62. ./gradlew generateGodotTemplates
  63. cd ../../..
  64. ls -l bin/
  65. - name: Upload artifact
  66. uses: ./.github/actions/upload-artifact