Skip to content

Commit eabd6fb

Browse files
committed
build: configure release pipeline and add flavor dimensions
This commit introduces the following changes: - Configures the release pipeline in the GitHub Actions workflow to set up the keystore, build release artifacts (APKs and AAB), and rename them with version information. - Adds "gms" and "standalone" product flavors to `app/build.gradle.kts`. - Configures signing for release builds using properties from `keystore.properties`. - Specifies different text recognition dependencies for "gms" and "standalone" flavors. - Includes a TODO for a future pipeline to release to Google Play.
1 parent 89eccdd commit eabd6fb

3 files changed

Lines changed: 70 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,31 @@ jobs:
9292
echo "Version Name: ${VERSION_NAME}"
9393
echo "Version Code: ${VERSION_CODE}"
9494
95+
- name: Setup Keystore
96+
env:
97+
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
98+
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
99+
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
100+
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
101+
run: |
102+
echo "$KEYSTORE_BASE64" | base64 --decode > release.jks
103+
echo "storeFile=release.jks" > keystore.properties
104+
echo "keyAlias=$KEY_ALIAS" >> keystore.properties
105+
echo "keyPassword=$KEY_PASSWORD" >> keystore.properties
106+
echo "storePassword=$STORE_PASSWORD" >> keystore.properties
95107
96108
- name: Create release folder
97109
run: mkdir -p app/build/outputs/apk/release
98110

99-
- name: Build release APK
100-
run: ./gradlew clean assembleRelease
111+
- name: Build release artifacts
112+
run: ./gradlew clean assembleRelease bundleGmsRelease
101113

102-
- name: Rename artifact
103-
run: mv "app/build/outputs/apk/release/app-release.apk" "app/build/outputs/apk/release/SummaryExpressive-${{ env.VERSION_NAME }}(${{ env.VERSION_CODE }}).apk"
114+
- name: Rename artifacts
115+
run: |
116+
mv "app/build/outputs/apk/gms/release/app-gms-release.apk" "app/build/outputs/apk/release/SummaryExpressive-gms-${{ env.VERSION_NAME }}(${{ env.VERSION_CODE }}).apk"
117+
mv "app/build/outputs/apk/standalone/release/app-standalone-release.apk" "app/build/outputs/apk/release/SummaryExpressive-standalone-${{ env.VERSION_NAME }}(${{ env.VERSION_CODE }}).apk"
118+
# TODO: pipeline to release to google play
119+
mv "app/build/outputs/bundle/gmsRelease/app-gms-release.aab" "app/build/outputs/apk/release/SummaryExpressive-gms-${{ env.VERSION_NAME }}(${{ env.VERSION_CODE }}).aab"
104120

105121
- name: Publish GitHub release
106122
uses: softprops/action-gh-release@v2
@@ -109,4 +125,4 @@ jobs:
109125
name: "Release ${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})"
110126
prerelease: false
111127
draft: false
112-
files: app/build/outputs/apk/release/SummaryExpressive-${{ env.VERSION_NAME }}(${{ env.VERSION_CODE }}).apk
128+
files: app/build/outputs/apk/release/SummaryExpressive-*.apk

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@
2424

2525
---
2626

27-
## Play Store Version (coming soon)
27+
## Download
28+
29+
### Github Release
30+
31+
There are 2 releases available:
32+
33+
- **standalone** which
34+
includes [ML model](https://developers.google.com/ml-kit/vision/text-recognition/v2) to recognize
35+
text from image, it got larger package size.
36+
37+
- **gms** which allows user to download the model from Google Play Services, but GMS required.
38+
39+
### Play Store Version (coming soon)
2840

2941
<a href='https://play.google.com/store/apps/details?id=me.nanova.SummaryExpressive'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width='300'/></a>
3042

@@ -48,9 +60,3 @@
4860
dynamic color theme.
4961

5062
It uses OpenAI/Gemini to summarize.
51-
52-
<div align="right">
53-
<table><td>
54-
<a href="#start-of-content">👆 Scroll to top</a>
55-
</td></table>
56-
</div>

app/build.gradle.kts

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import java.util.Properties
2+
import java.io.FileInputStream
3+
14
plugins {
25
id("com.android.application")
36
id("org.jetbrains.kotlin.android")
@@ -9,19 +12,46 @@ plugins {
912
android {
1013
namespace = "me.nanova.summaryexpressive"
1114
compileSdk = 36
15+
flavorDimensions += "distribution"
1216
androidResources {
1317
generateLocaleConfig = true
1418
}
1519
defaultConfig {
1620
applicationId = "me.nanova.summaryexpressive"
1721
minSdk = 33
1822
targetSdk = 36
19-
versionCode = 3
20-
versionName = "0.0.3"
23+
versionCode = 4
24+
versionName = "0.0.4"
2125

2226
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
27+
}
2328

29+
productFlavors {
30+
create("gms") {
31+
dimension = "distribution"
32+
}
33+
create("standalone") {
34+
dimension = "distribution"
35+
applicationIdSuffix = ".standalone"
36+
versionNameSuffix = "-standalone"
37+
}
2438
}
39+
40+
signingConfigs {
41+
val keyPropertiesFile = rootProject.file("keystore.properties")
42+
val keyProperties = Properties()
43+
if (keyPropertiesFile.exists()) {
44+
keyProperties.load(FileInputStream(keyPropertiesFile))
45+
}
46+
47+
create("release") {
48+
keyAlias = keyProperties.getProperty("keyAlias")
49+
keyPassword = keyProperties.getProperty("keyPassword")
50+
storeFile = if (keyProperties.getProperty("storeFile") != null) rootProject.file(keyProperties.getProperty("storeFile")) else null
51+
storePassword = keyProperties.getProperty("storePassword")
52+
}
53+
}
54+
2555
buildTypes {
2656
release {
2757
isMinifyEnabled = true
@@ -30,7 +60,7 @@ android {
3060
getDefaultProguardFile("proguard-android-optimize.txt"),
3161
"proguard-rules.pro"
3262
)
33-
signingConfig = signingConfigs.getByName("debug")
63+
signingConfig = signingConfigs.getByName("release")
3464
}
3565
getByName("debug") {
3666
signingConfig = signingConfigs.getByName("debug")
@@ -84,9 +114,9 @@ dependencies {
84114
implementation("androidx.datastore:datastore-preferences:1.1.7")
85115

86116
// ml & llm
87-
// this will bundle model to apk which is huge, use play service one first
88-
// implementation("com.google.mlkit:text-recognition:16.0.1")
89-
implementation("com.google.android.gms:play-services-mlkit-text-recognition:19.0.1")
117+
// this will bundle model to apk which is huge
118+
"standaloneImplementation"("com.google.mlkit:text-recognition:16.0.1")
119+
"gmsImplementation"("com.google.android.gms:play-services-mlkit-text-recognition:19.0.1")
90120
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10.2")
91121
implementation("io.ktor:ktor-client-android:3.2.2")
92122
implementation("ai.koog:koog-agents:0.3.0") {

0 commit comments

Comments
 (0)