update android release settings (#970)

* update android release settings

* more

* more

* more

* more
This commit is contained in:
Logan McNaughton
2026-05-28 13:04:52 +02:00
committed by GitHub
parent e23894c2e6
commit bb32a0a8ba
3 changed files with 53 additions and 2 deletions
+30 -1
View File
@@ -270,15 +270,44 @@ jobs:
uses: android-actions/setup-android@v4
with:
packages: "platforms;android-${{ matrix.platform }} ndk;${{ matrix.ndk }}"
- name: Decode keystore and create jks
if: ${{ github.ref_type == 'tag' }}
working-directory: android-project
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > keystore.jks
cat <<EOF > keystore.properties
storePassword=${{ secrets.ANDROID_STORE_PASSWORD }}
keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}
keyAlias=gopher64
storeFile=keystore.jks
EOF
- name: Build
working-directory: android-project
run: |
cargo install cargo-ndk
./gradlew assemble${{ env.BUILD_PROFILE == 'release' && 'Release' || 'Debug' }}
mkdir output
cp app/build/outputs/apk/${{ env.BUILD_DIR }}/app-${{ env.BUILD_DIR }}.apk output/Gopher64-android.apk
- name: Upload file
uses: actions/upload-artifact@v7
with:
name: gopher64-android
path: android-project/output/Gopher64-android.apk
archive: false
- name: Setup butler
if: ${{ github.ref_type == 'tag' }}
uses: remarkablegames/setup-butler@v3
- name: Upload to itch.io
if: ${{ github.ref_type == 'tag' }}
run: |
butler push android-project/output/Gopher64-android.apk loganmc10/gopher64:android --userversion ${GITHUB_REF_NAME#v}
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
collect-artifacts:
name: Collect release artifacts
needs: [build-linux, build-windows, build-macos]
needs: [build-linux, build-windows, build-macos, build-android]
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
+1
View File
@@ -6,6 +6,7 @@ jniLibs/
# Local configuration file (sdk path, etc)
local.properties
keystore.properties
# Log/OS Files
*.log
+22 -1
View File
@@ -1,4 +1,6 @@
import groovy.json.JsonSlurper
import java.util.Properties
import java.io.FileInputStream
plugins {
alias(libs.plugins.android.application)
@@ -8,6 +10,12 @@ kotlin {
jvmToolchain(17)
}
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android {
namespace = "io.github.gopher64.gopher64"
compileSdk {
@@ -31,9 +39,22 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
if (keystorePropertiesFile.exists()) {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["storePassword"] as String
}
}
}
buildTypes {
release {
signingConfig = signingConfigs["debug"]
if (keystorePropertiesFile.exists()) {
signingConfig = signingConfigs["release"]
}
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(