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
|
name: Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
push:
|
||||||
build_type:
|
tags:
|
||||||
description: 'Select build type'
|
- "v*"
|
||||||
required: true
|
|
||||||
default: 'release'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- release
|
|
||||||
- alpha
|
|
||||||
- beta
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
BUILD_TYPE: ${{ github.event.inputs.build_type || 'release' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -34,13 +23,23 @@ jobs:
|
|||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
run: chmod +x 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
|
- 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
|
- name: Gitea Release
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
files: "composeApp/build/outputs/apk/${{ env.BUILD_TYPE }}/*.apk"
|
files: "composeApp/build/outputs/apk/release/*.apk"
|
||||||
server_url: "https://git.reya.su/"
|
server_url: "https://git.reya.su/"
|
||||||
repository: "reya/coop-mobile"
|
repository: "reya/coop-mobile"
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
import java.util.Properties
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlinMultiplatform)
|
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 {
|
android {
|
||||||
namespace = "su.reya.coop"
|
namespace = "su.reya.coop"
|
||||||
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
||||||
|
|
||||||
|
base.archivesName.set("coop")
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
create("release") {
|
create("release") {
|
||||||
storeFile = localProperties.getProperty("keystore.path")?.let { file(it) }
|
val path = System.getenv("KEYSTORE_PATH")
|
||||||
storePassword = localProperties.getProperty("keystore.password")
|
storeFile = path?.let { file(it) }
|
||||||
keyAlias = localProperties.getProperty("key.alias")
|
storePassword = System.getenv("KEYSTORE_PASSWORD")
|
||||||
keyPassword = localProperties.getProperty("key.password")
|
keyAlias = System.getenv("KEY_ALIAS")
|
||||||
|
keyPassword = System.getenv("KEY_PASSWORD")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
@@ -72,7 +67,7 @@ android {
|
|||||||
minSdk = libs.versions.android.minSdk.get().toInt()
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
||||||
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
versionName = "0.1.0"
|
versionName = "0.1.1"
|
||||||
}
|
}
|
||||||
packaging {
|
packaging {
|
||||||
resources {
|
resources {
|
||||||
@@ -84,24 +79,11 @@ android {
|
|||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt")
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro",
|
||||||
)
|
)
|
||||||
signingConfig = signingConfigs.getByName("release")
|
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 {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
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