2023-12-28 06:00:21 +00:00
name : Manual Generate Android APK
2022-03-20 03:37:48 +00:00
on :
workflow_dispatch :
inputs :
buildVariant :
type : choice
2024-03-27 14:59:38 +00:00
description : 'Build Variant'
2022-03-20 03:37:48 +00:00
required : true
default : 'NormalOptimized'
options :
- NormalOptimized
- NormalDebug
2024-04-06 12:48:01 +00:00
- VROptimized
- VRDebug
2024-08-15 22:01:00 +00:00
- LegacyOptimized
2022-03-20 03:37:48 +00:00
jobs :
apk :
name : Generate ${{ github.event.inputs.buildVariant }} APK
runs-on : ubuntu-latest
steps :
2024-03-27 14:59:38 +00:00
- uses : actions/checkout@v4
2022-03-20 03:37:48 +00:00
with :
fetch-depth : 0
submodules : recursive
2024-03-27 14:59:38 +00:00
- name : Check Valid Version Tags
id : valid-tags
shell : bash
run : |
echo "count=$(git tag -l 'v[0-9]*' | wc -l | tr -d ' ')" >> $GITHUB_OUTPUT
- name : Fetch upstream tags # required for git describe to return a valid version and to preevnt androidGitVersion from crashing on a new fork
if : ${{ steps.valid-tags.outputs.count == '0' }}
run : |
# TODO: should try to fetch tags from whereever this repo was forked from before fetching from official repo
git remote add upstream https://github.com/hrydgard/ppsspp.git # fetching from official repo as a fallback
git fetch --deepen=15000 --no-recurse-submodules --tags upstream || exit 0
2022-03-20 03:37:48 +00:00
- name : Setup JDK
2024-03-27 14:59:38 +00:00
uses : actions/setup-java@v4
2022-03-20 03:37:48 +00:00
with :
2024-03-27 14:59:38 +00:00
distribution : 'temurin'
2023-12-20 15:09:39 +00:00
java-version : '17'
2024-03-27 14:59:38 +00:00
cache : 'gradle'
2022-03-20 03:37:48 +00:00
2024-03-27 14:59:38 +00:00
#- name: Setup SDK # gradlew will install SDK automatically, thus this step not needed
# uses: android-actions/setup-android@v3
2022-03-20 03:37:48 +00:00
2024-03-27 14:59:38 +00:00
#- name: Setup NDK # gradle will install NDK (side by side) automatically, thus explictly seting up NDK here will cause not enough storage issue when building debug variant
2022-03-20 03:37:48 +00:00
# uses: nttld/setup-ndk@v1
# with:
2022-07-25 00:45:01 +00:00
# ndk-version: r21e
2024-03-27 14:59:38 +00:00
- name : Test androidGitVersion
run : |
echo "count=${{steps.valid-tags.outputs.count}}"
gradle --quiet androidGitVersion
2022-03-20 03:37:48 +00:00
- name : Assemble APK
2024-03-27 14:59:38 +00:00
run : ./gradlew assemble${{ github.event.inputs.buildVariant }} --stacktrace
2022-03-20 03:37:48 +00:00
#- name: Gradle Test
# run: bash ./gradlew test${{ github.event.inputs.buildVariant }}UnitTest --stacktrace
- name : Package build
run : |
find . -name "*.apk"
mkdir ppsspp
2024-03-27 14:59:38 +00:00
if [ -e android/build/*/apk/*/*/*.apk ]; then
cp android/build/*/apk/*/*/*.apk ppsspp/
2022-03-20 03:37:48 +00:00
fi
2023-12-28 06:00:21 +00:00
- name : Upload artifact
2024-03-27 14:59:38 +00:00
uses : actions/upload-artifact@v4
2022-03-20 03:37:48 +00:00
with :
name : android-${{ github.event.inputs.buildVariant }} build
path : ppsspp/