debug_apk.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Debug Build APK
  2. on:
  3. - workflow_dispatch
  4. jobs:
  5. libcore:
  6. name: Native Build (LibCore)
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Checkout
  10. uses: actions/checkout@v3
  11. - name: Fetch Status
  12. run: git submodule status library/core > libcore_status
  13. - name: LibCore Cache
  14. id: cache
  15. uses: actions/cache@v3
  16. with:
  17. path: |
  18. app/libs/libcore.aar
  19. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }}
  20. - name: Get latest go version
  21. id: version
  22. if: steps.cache.outputs.cache-hit != 'true'
  23. run: |
  24. echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
  25. - name: Setup Go
  26. uses: actions/setup-go@v3
  27. if: steps.cache.outputs.cache-hit != 'true'
  28. with:
  29. # Bug: https://github.com/golang/go/issues/58426
  30. # go-version: ${{ steps.version.outputs.go_version }}
  31. go-version: 1.19.8
  32. - name: Gradle cache
  33. uses: actions/cache@v3
  34. if: steps.cache.outputs.cache-hit != 'true'
  35. with:
  36. path: ~/.gradle
  37. key: native-${{ hashFiles('**/*.gradle.kts') }}
  38. - name: Native Build
  39. if: steps.cache.outputs.cache-hit != 'true'
  40. run: |
  41. echo "sdk.dir=${ANDROID_HOME}" > local.properties
  42. echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
  43. ./run lib core
  44. build:
  45. name: Gradle Build
  46. runs-on: ubuntu-latest
  47. needs:
  48. - libcore
  49. steps:
  50. - name: Checkout
  51. uses: actions/checkout@v3
  52. - name: Fetch Status
  53. run: |
  54. git submodule status library/core > libcore_status
  55. - name: LibCore Cache
  56. uses: actions/cache@v3
  57. with:
  58. path: |
  59. app/libs/libcore.aar
  60. key: ${{ hashFiles('.github/workflows/*', 'bin/lib/core/*', 'libcore_status') }}
  61. - name: Gradle cache
  62. uses: actions/cache@v3
  63. with:
  64. path: ~/.gradle
  65. key: gradle-${{ hashFiles('**/*.gradle.kts') }}
  66. - name: Debug Build
  67. env:
  68. BUILD_PLUGIN: none
  69. run: |
  70. echo "sdk.dir=${ANDROID_HOME}" > local.properties
  71. echo "ndk.dir=${ANDROID_HOME}/ndk/25.0.8775105" >> local.properties
  72. export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
  73. ./run init action library
  74. ./gradlew app:assembleOssRelease
  75. APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk')
  76. APK=$(dirname "$APK")
  77. echo "APK=$APK" >> $GITHUB_ENV
  78. - uses: actions/upload-artifact@v3
  79. with:
  80. name: APKs
  81. path: ${{ env.APK }}
  82. - uses: actions/upload-artifact@v3
  83. with:
  84. name: "SHA256-ARM ${{ env.SHA256_ARM }}"
  85. path: ${{ env.SUM_ARM }}
  86. - uses: actions/upload-artifact@v3
  87. with:
  88. name: "SHA256-ARM64 ${{ env.SHA256_ARM64 }}"
  89. path: ${{ env.SUM_ARM64 }}
  90. - uses: actions/upload-artifact@v3
  91. with:
  92. name: "SHA256-X64 ${{ env.SHA256_X64 }}"
  93. path: ${{ env.SUM_X64 }}
  94. - uses: actions/upload-artifact@v3
  95. with:
  96. name: "SHA256-X86 ${{ env.SHA256_X86 }}"
  97. path: ${{ env.SUM_X86 }}