Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d25cb36bd | |||
| 439cf60b66 | |||
| f1f603525b | |||
| 5c7027e559 | |||
| 4bcb2518b7 | |||
| 25852e08a9 |
31
.github/workflows/android.yml
vendored
31
.github/workflows/android.yml
vendored
@@ -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 }}
|
||||
@@ -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
11
composeApp/proguard-rules.pro
vendored
Normal 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
|
||||
Reference in New Issue
Block a user