This commit is contained in:
SSimco
2025-03-10 19:11:37 +02:00
parent 0c412caa09
commit 3bc76a7048
10 changed files with 94 additions and 85 deletions
-1
View File
@@ -285,7 +285,6 @@ jobs:
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
EMULATOR_VERSION_MAJOR: ${{ inputs.next_version_major }}
EMULATOR_VERSION_MINOR: ${{ inputs.next_version_minor }}
VERSION_CODE: ${{ github.run_number }}
run: |
cd ./src/android
if [[ -z "$ANDROID_STORE_FILE_BASE64" ]]; then
@@ -38,8 +38,8 @@ on:
description: 'Feature 9'
required: false
type: string
changelog9:
description: 'Feature 10'
android_build_type:
description: 'Build type'
required: false
type: string
@@ -53,6 +53,7 @@ jobs:
with:
next_version_major: ${{ needs.calculate-version.outputs.next_version_major }}
next_version_minor: ${{ needs.calculate-version.outputs.next_version_minor }}
android_build_type: ${{ inputs.android_build_type }}
deploy:
name: Deploy experimental release
runs-on: ubuntu-22.04
@@ -75,7 +76,6 @@ jobs:
if [ -n "${{ github.event.inputs.changelog6 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog6 }}\n"; fi
if [ -n "${{ github.event.inputs.changelog7 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog7 }}\n"; fi
if [ -n "${{ github.event.inputs.changelog8 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog8 }}\n"; fi
if [ -n "${{ github.event.inputs.changelog9 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog9 }}\n"; fi
echo -e "$CHANGELOG"
echo "RELEASE_BODY=$CHANGELOG" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
+43 -21
View File
@@ -1,46 +1,68 @@
name: Deploy experimental android release
on:
workflow_dispatch:
inputs:
build_type:
description: Build type
required: false
type: string
version_major:
description: Version major
required: false
type: string
version_minor:
description: Version minor
required: false
type: string
jobs:
call-release-build:
uses: ./.github/workflows/android_build.yml
secrets: inherit
deploy:
name: Deploy experimental release
runs-on: ubuntu-22.04
needs: [call-release-build]
steps:
- uses: actions/checkout@v4
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0
- uses: actions/download-artifact@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
name: cemu-android
path: cemu-android
java-version: "17"
distribution: "temurin"
- name: Initialize
- name: Build Cemu
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 }}
EMULATOR_VERSION_MAJOR: ${{ inputs.version_major }}
EMULATOR_VERSION_MINOR: ${{ inputs.version_minor }}
BUILD_TYPE: ${{ inputs.build_type }}
run: |
mkdir upload
sudo apt install zip
cd ./src/android
if [[ -z "$ANDROID_STORE_FILE_BASE64" ]]; then
base64 --decode <<< "${ANDROID_STORE_FILE_BASE64}" > store.jks
export ANDROID_STORE_FILE=$(pwd)/store.jks
fi
./gradlew assemble$BUILD_TYPE
- name: Set version dependent vars
env:
EMULATOR_VERSION_MAJOR: ${{ inputs.version_major }}
EMULATOR_VERSION_MINOR: ${{ inputs.version_minor }}
run: |
echo "CEMU_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Create release from apk
run: |
VERSION=${{ env.CEMU_VERSION }}
echo "Cemu Version is $VERSION"
ls cemu-android
mv cemu-android/*.apk upload/Cemu-$VERSION.apk
echo "CEMU_VERSION=$EMULATOR_VERSION_MAJOR.$EMULATOR_VERSION_MINOR" >> $GITHUB_ENV
- name: Create release
run: |
VERSION=${{ env.CEMU_VERSION }}
mkdir upload
mv ./src/android/app/build/outputs/apk/*/*.apk upload/Cemu-$VERSION.apk
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz
tar xvzf ghr.tar.gz; rm ghr.tar.gz
echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}"
RELEASE_BODY=$(printf "Experimental release\n%s" "Latest commit ${{ env.CEMU_VERSION }}")
RELEASE_BODY=$(printf "Experimental release %s" "${{ env.CEMU_VERSION }}")
ghr_v0.15.0_linux_amd64/ghr -b "$RELEASE_BODY" -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }}" "${{ env.CEMU_VERSION }}" ./upload
@@ -29,7 +29,7 @@ jobs:
id: get_all_releases
run: |
# Fetch all releases and check for API errors
RESPONSE=$(curl -s -o response.json -w "%{http_code}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=100")
RESPONSE=$(curl -s -o response.json -w "%{http_code}" "https://api.github.com/repos/cemu-project/cemu/releases?per_page=100")
if [ "$RESPONSE" -ne 200 ]; then
echo "Failed to fetch releases. HTTP status: $RESPONSE"
cat response.json
+25 -20
View File
@@ -41,7 +41,7 @@ android {
ndkVersion = "26.1.10909125"
defaultConfig {
applicationId = "info.cemu.cemu"
minSdk = 30
minSdk = 31
targetSdk = 35
versionCode = getVersionCode()
versionName = getVersionName()
@@ -53,33 +53,38 @@ android {
val keystoreFilePath: String? = System.getenv("ANDROID_KEYSTORE_FILE")
signingConfigs {
if (keystoreFilePath != null) {
signingConfigs {
create("release") {
storeFile = file(keystoreFilePath)
storePassword = System.getenv("ANDROID_KEY_STORE_PASSWORD")
keyAlias = System.getenv("ANDROID_KEY_ALIAS")
keyPassword = System.getenv("ANDROID_KEYSTORE_PASS")
}
create("releaseSigningConfig") {
storeFile = file(keystoreFilePath)
storePassword = System.getenv("ANDROID_KEY_STORE_PASSWORD")
keyAlias = System.getenv("ANDROID_KEY_ALIAS")
keyPassword = System.getenv("ANDROID_KEYSTORE_PASS")
}
}
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = if (keystoreFilePath != null) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")
androidComponents {
beforeVariants { variantBuilder ->
if (variantBuilder.name == "release") {
variantBuilder.enable = false
}
}
}
buildTypes {
debug {
applicationIdSuffix = ".debug"
}
create("githubRelease") {
if (keystoreFilePath != null) {
initWith(getByName("release"))
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("releaseSigningConfig")
} else {
initWith(getByName("debug"))
}
}
}
compileOptions {
sourceCompatibility(JavaVersion.VERSION_17)
+1 -18
View File
@@ -20,8 +20,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Cemu"
tools:targetApi="31">
android:theme="@style/Theme.Cemu">
<activity
android:name=".MainActivity"
android:exported="true">
@@ -31,22 +30,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".about.AboutCemuActivity"
android:exported="false"
android:parentActivityName=".MainActivity" />
<activity
android:name=".graphicpacks.GraphicPacksActivity"
android:exported="false"
android:parentActivityName=".MainActivity" />
<activity
android:name=".settings.SettingsActivity"
android:exported="false"
android:parentActivityName=".MainActivity" />
<activity
android:name=".titlemanager.TitleManagerActivity"
android:exported="false"
android:parentActivityName=".MainActivity" />
<activity
android:name=".emulation.EmulationActivity"
android:configChanges="orientation|screenSize"
@@ -348,6 +348,7 @@ Java_info_cemu_cemu_nativeinterface_NativeSettings_getCustomDriverPath(JNIEnv* e
extern "C" [[maybe_unused]] JNIEXPORT void JNICALL
Java_info_cemu_cemu_nativeinterface_NativeSettings_setCustomDriverPath(JNIEnv* env, [[maybe_unused]] jclass clazz, jstring custom_driver_path)
{
throw std::runtime_error("todo");
g_config.data().custom_driver_path = JNIUtils::toString(env, custom_driver_path);
}
@@ -25,6 +25,7 @@ import info.cemu.cemu.BuildConfig
import info.cemu.cemu.R
import info.cemu.cemu.guicore.components.ScreenContent
// TODO
@Composable
fun AboutCemuScreen(navigateBack: () -> Unit) {
ScreenContent(
@@ -2,7 +2,6 @@ package info.cemu.cemu.guicore.components
import androidx.annotation.IntRange
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -10,7 +9,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
@@ -29,19 +27,19 @@ fun Slider(
onValueChange: (Int) -> Unit,
) {
var value by rememberSaveable { mutableFloatStateOf(initialValue().toFloat()) }
Row(modifier = Modifier.padding(8.dp), verticalAlignment = Alignment.CenterVertically) {
Column(modifier = Modifier.padding(end = 8.dp)) {
Text(
text = label,
fontWeight = FontWeight.Medium,
fontSize = 16.sp,
)
Text(
text = labelFormatter(value.fastRoundToInt()),
fontWeight = FontWeight.Light,
fontSize = 14.sp,
)
}
Column(modifier = Modifier.padding(8.dp)) {
Text(
modifier = Modifier.padding(bottom = 8.dp),
text = label,
fontWeight = FontWeight.Medium,
fontSize = 16.sp,
)
Text(
modifier = Modifier.padding(top = 8.dp),
text = labelFormatter(value.fastRoundToInt()),
fontWeight = FontWeight.Light,
fontSize = 14.sp,
)
MaterialSlider(
valueRange = valueFrom.toFloat()..valueTo.toFloat(),
steps = steps,
@@ -30,12 +30,12 @@ fun GraphicsSettingsScreen(navigateBack: () -> Unit, goToCustomDriversSettings:
appBarText = stringResource(R.string.general_settings),
navigateBack = navigateBack,
) {
if (supportsLoadingCustomDrivers) {
Button(
label = stringResource(R.string.custom_drivers),
onClick = goToCustomDriversSettings
)
}
// if (supportsLoadingCustomDrivers) {
// Button(
// label = stringResource(R.string.custom_drivers),
// onClick = goToCustomDriversSettings
// )
// }
Toggle(
label = stringResource(R.string.async_shader_compile),
description = stringResource(R.string.async_shader_compile_description),