6 Commits

Author SHA1 Message Date
2d25cb36bd chore: bump version
Some checks failed
Build and Release / build (push) Has been cancelled
2026-05-23 20:40:56 +07:00
439cf60b66 chore: fix proguard issues (#2)
Reviewed-on: #2
2026-05-23 13:40:05 +00:00
f1f603525b chore: fix apk signing 2026-05-23 13:45:23 +07:00
5c7027e559 chore: fix build 2026-05-23 13:31:48 +07:00
4bcb2518b7 chore: fix ci 2026-05-23 13:04:27 +07:00
25852e08a9 chore: fix github ci 2026-05-23 12:43:54 +07:00
3 changed files with 36 additions and 44 deletions

View File

@@ -1,25 +1,14 @@
name: Build and Release
on:
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
build_type:
description: 'Select build type'
required: true
default: 'release'
type: choice
options:
- release
- alpha
- beta
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_TYPE: ${{ github.event.inputs.build_type || 'release' }}
steps:
- uses: actions/checkout@v4
@@ -34,13 +23,23 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Decode Keystore
run: |
# Decodes the Base64 string from secrets to a physical file
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > composeApp/release.jks
- name: Build APK
run: ./gradlew :composeApp:assemble${{ env.BUILD_TYPE }}
run: ./gradlew :composeApp:assembleRelease
env:
KEYSTORE_PATH: release.jks
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Gitea Release
uses: akkuman/gitea-release-action@v1
with:
files: "composeApp/build/outputs/apk/${{ env.BUILD_TYPE }}/*.apk"
files: "composeApp/build/outputs/apk/release/*.apk"
server_url: "https://git.reya.su/"
repository: "reya/coop-mobile"
token: ${{ secrets.GITEA_TOKEN }}

View File

@@ -1,5 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.Properties
plugins {
alias(libs.plugins.kotlinMultiplatform)
@@ -48,23 +47,19 @@ kotlin {
}
}
val localProperties = Properties().apply {
val file = rootProject.file("local.properties")
if (file.exists()) {
load(file.inputStream())
}
}
android {
namespace = "su.reya.coop"
compileSdk = libs.versions.android.compileSdk.get().toInt()
base.archivesName.set("coop")
signingConfigs {
create("release") {
storeFile = localProperties.getProperty("keystore.path")?.let { file(it) }
storePassword = localProperties.getProperty("keystore.password")
keyAlias = localProperties.getProperty("key.alias")
keyPassword = localProperties.getProperty("key.password")
val path = System.getenv("KEYSTORE_PATH")
storeFile = path?.let { file(it) }
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEY_ALIAS")
keyPassword = System.getenv("KEY_PASSWORD")
}
}
defaultConfig {
@@ -72,7 +67,7 @@ android {
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "0.1.0"
versionName = "0.1.1"
}
packaging {
resources {
@@ -84,24 +79,11 @@ android {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt")
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
signingConfig = signingConfigs.getByName("release")
}
create("beta") {
initWith(getByName("release"))
applicationIdSuffix = ".beta"
versionNameSuffix = "-beta"
manifestPlaceholders["appName"] = "Coop Beta"
signingConfig = signingConfigs.getByName("release")
}
create("alpha") {
initWith(getByName("release"))
applicationIdSuffix = ".alpha"
versionNameSuffix = "-alpha"
manifestPlaceholders["appName"] = "Coop Alpha"
signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11

11
composeApp/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,11 @@
-dontwarn com.sun.jna.**
-keep class com.sun.jna.** { *; }
-keep class * extends com.sun.jna.Structure { *; }
-keep class * extends com.sun.jna.Library { *; }
-keep class * extends com.sun.jna.Callback { *; }
-keep class rust.nostr.sdk.** { *; }
-keep class su.reya.nostr.** { *; }
-keepattributes Signature, InnerClasses, EnclosingMethod, RuntimeVisibleAnnotations