android-build.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # SPDX-FileCopyrightText: 2022 yuzu Emulator Project
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. name: 'yuzu-android-build'
  4. on:
  5. push:
  6. tags: [ "*" ]
  7. jobs:
  8. android:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v3
  12. with:
  13. submodules: recursive
  14. fetch-depth: 0
  15. - name: Set up JDK 17
  16. uses: actions/setup-java@v3
  17. with:
  18. java-version: '17'
  19. distribution: 'temurin'
  20. - name: Set up cache
  21. uses: actions/cache@v3
  22. with:
  23. path: |
  24. ~/.gradle/caches
  25. ~/.gradle/wrapper
  26. ~/.ccache
  27. key: ${{ runner.os }}-android-${{ github.sha }}
  28. restore-keys: |
  29. ${{ runner.os }}-android-
  30. - name: Query tag name
  31. uses: olegtarasov/get-tag@v2.1.2
  32. id: tagName
  33. - name: Install dependencies
  34. run: |
  35. sudo apt-get update
  36. sudo apt-get install -y ccache apksigner glslang-dev glslang-tools
  37. - name: Build
  38. run: ./.ci/scripts/android/build.sh
  39. - name: Copy and sign artifacts
  40. env:
  41. ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
  42. ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
  43. ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }}
  44. run: ./.ci/scripts/android/upload.sh
  45. - name: Upload
  46. uses: actions/upload-artifact@v3
  47. with:
  48. name: android
  49. path: artifacts/
  50. # release steps
  51. release-android:
  52. runs-on: ubuntu-latest
  53. needs: [android]
  54. if: ${{ startsWith(github.ref, 'refs/tags/') }}
  55. permissions:
  56. contents: write
  57. steps:
  58. - uses: actions/download-artifact@v3
  59. - name: Query tag name
  60. uses: olegtarasov/get-tag@v2.1.2
  61. id: tagName
  62. - name: Create release
  63. uses: actions/create-release@v1
  64. env:
  65. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  66. with:
  67. tag_name: ${{ steps.tagName.outputs.tag }}
  68. release_name: ${{ steps.tagName.outputs.tag }}
  69. draft: false
  70. prerelease: false
  71. - name: Upload artifacts
  72. uses: alexellis/upload-assets@0.2.3
  73. env:
  74. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  75. with:
  76. asset_paths: '["./**/*.apk","./**/*.aab"]'