Added ci for building the android app

This commit is contained in:
SSimco
2024-07-09 14:28:50 +03:00
parent aae6313fdb
commit 3f5d6eda66
2 changed files with 72 additions and 2 deletions
+51
View File
@@ -0,0 +1,51 @@
name: Android build
on:
workflow_dispatch:
push:
branches: ["android"]
pull_request:
branches: ["android"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0
- name: Fetch full history for vcpkg submodule
run: |
cd dependencies/vcpkg
git fetch --unshallow
git pull --all
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Build Cemu for Android
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 }}
run: |
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
./gradlew assembleRelease
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cemu-android
path: |
./src/android/app/build/outputs/apk/release/*.apk
./src/android/app/build/outputs/apk/release/*.aab
+21 -2
View File
@@ -1,6 +1,11 @@
plugins {
id 'com.android.application'
}
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace 'info.cemu.Cemu'
@@ -18,12 +23,26 @@ android {
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
var releaseStoreFile = keystoreProperties['storeFile'];
signingConfigs {
if (releaseStoreFile != null) {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyStorePassword']
storeFile file(releaseStoreFile)
storePassword keystoreProperties['keyStorePassword']
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
if (releaseStoreFile != null) {
signingConfig signingConfigs.release
} else {
signingConfig signingConfigs.debug
}
}
debug {
applicationIdSuffix ".debug"