2024-07-09 11:28:50 +00:00
|
|
|
name: Android build
|
|
|
|
|
|
|
|
on:
|
2024-09-21 21:00:28 +00:00
|
|
|
workflow_call:
|
2024-07-09 11:28:50 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches: ["android"]
|
|
|
|
pull_request:
|
|
|
|
branches: ["android"]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-10-30 12:16:13 +00:00
|
|
|
runs-on: self-hosted
|
2024-07-09 11:28:50 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
2024-10-30 12:16:13 +00:00
|
|
|
token: ${{ secrets.GH_PAT }}
|
2024-07-09 11:28:50 +00:00
|
|
|
submodules: "recursive"
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: "17"
|
|
|
|
distribution: "temurin"
|
|
|
|
|
2024-09-04 10:48:20 +00:00
|
|
|
- name: Create store file
|
2024-07-09 11:28:50 +00:00
|
|
|
env:
|
|
|
|
ANDROID_STORE_FILE_BASE64: ${{ secrets.ANDROID_STORE_FILE_BASE64 }}
|
|
|
|
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
|
|
|
|
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
2024-09-04 10:48:20 +00:00
|
|
|
if: "${{ env.ANDROID_STORE_FILE_BASE64 != '' }}"
|
2024-07-09 11:28:50 +00:00
|
|
|
run: |
|
2024-10-25 13:50:15 +00:00
|
|
|
echo "BUILD_TYPE=Release" >> "$GITHUB_ENV"
|
2024-07-09 11:28:50 +00:00
|
|
|
cd ./src/android
|
|
|
|
base64 --decode <<< "${ANDROID_STORE_FILE_BASE64}" > store.jks
|
|
|
|
ANDROID_STORE_FILE=$(pwd)/store.jks
|
|
|
|
echo -e "keyStorePassword=$ANDROID_KEY_STORE_PASSWORD\nkeyAlias=$ANDROID_KEY_ALIAS\nstoreFile=$ANDROID_STORE_FILE\n" > keystore.properties
|
2024-09-04 10:48:20 +00:00
|
|
|
|
|
|
|
- name: Build Cemu for Android
|
|
|
|
run: |
|
2024-10-25 13:50:15 +00:00
|
|
|
if [[ -z "$BUILD_TYPE" ]]; then
|
|
|
|
BUILD_TYPE=Debug
|
|
|
|
fi
|
2024-09-04 10:48:20 +00:00
|
|
|
cd ./src/android
|
2024-10-25 13:50:15 +00:00
|
|
|
./gradlew assemble$BUILD_TYPE
|
2024-07-09 11:28:50 +00:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: cemu-android
|
|
|
|
path: |
|
2024-10-25 13:50:15 +00:00
|
|
|
./src/android/app/build/outputs/apk/*/*.apk
|
|
|
|
./src/android/app/build/outputs/apk/*/*.aab
|