build.sh 750 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash -ex
  2. # SPDX-FileCopyrightText: 2023 yuzu Emulator Project
  3. # SPDX-FileCopyrightText: 2024 suyu Emulator Project
  4. # SPDX-License-Identifier: GPL-3.0-or-later
  5. export NDK_CCACHE="$(which ccache)"
  6. ccache -s
  7. BUILD_FLAVOR="mainline"
  8. BUILD_TYPE="release"
  9. if [ "${GITHUB_REPOSITORY}" == "suyu/suyu" ]; then
  10. BUILD_TYPE="relWithDebInfo"
  11. fi
  12. if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then
  13. export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks"
  14. base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}"
  15. fi
  16. cd src/android
  17. chmod +x ./gradlew
  18. ./gradlew "assemble${BUILD_FLAVOR}${BUILD_TYPE}" "bundle${BUILD_FLAVOR}${BUILD_TYPE}"
  19. ccache -s
  20. if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then
  21. rm "${ANDROID_KEYSTORE_FILE}"
  22. fi