diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb2cede1..ce49c9ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/deploy_experimental_release.yml b/.github/workflows/deploy_experimental_release.yml index 40727035..f901e54a 100644 --- a/.github/workflows/deploy_experimental_release.yml +++ b/.github/workflows/deploy_experimental_release.yml @@ -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 diff --git a/.github/workflows/deploy_release_android.yml b/.github/workflows/deploy_release_android.yml index 2e63da56..dda63062 100644 --- a/.github/workflows/deploy_release_android.yml +++ b/.github/workflows/deploy_release_android.yml @@ -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 diff --git a/.github/workflows/determine_release_version.yml b/.github/workflows/determine_release_version.yml index be606941..1be2ac45 100644 --- a/.github/workflows/determine_release_version.yml +++ b/.github/workflows/determine_release_version.yml @@ -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 diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 8a6720ea..f52db59e 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -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) diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index c2618445..f18f47ff 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml @@ -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"> @@ -31,22 +30,6 @@ - - - - Unit) { ScreenContent( diff --git a/src/android/app/src/main/java/info/cemu/cemu/guicore/components/Slider.kt b/src/android/app/src/main/java/info/cemu/cemu/guicore/components/Slider.kt index d9d2151d..8b5fb8f1 100644 --- a/src/android/app/src/main/java/info/cemu/cemu/guicore/components/Slider.kt +++ b/src/android/app/src/main/java/info/cemu/cemu/guicore/components/Slider.kt @@ -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, diff --git a/src/android/app/src/main/java/info/cemu/cemu/settings/graphics/GraphicsSettingsScreen.kt b/src/android/app/src/main/java/info/cemu/cemu/settings/graphics/GraphicsSettingsScreen.kt index 403b6d76..41d21f09 100644 --- a/src/android/app/src/main/java/info/cemu/cemu/settings/graphics/GraphicsSettingsScreen.kt +++ b/src/android/app/src/main/java/info/cemu/cemu/settings/graphics/GraphicsSettingsScreen.kt @@ -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),