Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 796c76f

Browse files
author
soraefir
committed
CI Signing
1 parent 517f024 commit 796c76f

File tree

4 files changed

+44
-7
lines changed

4 files changed

+44
-7
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v4
26+
run: |
27+
echo "${{ secrets.RELEASE_KEYSTORE }}" > keystore.asc
28+
echo "${{ secrets.RELEASE_KEY}}" > key.acs
29+
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch keystore.asc > app/keystore.properties
30+
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch key.asc > app/key.jks
31+
2632
- uses: gradle/wrapper-validation-action@v2
2733

2834
- name: create and checkout branch
@@ -41,14 +47,14 @@ jobs:
4147
- name: Build APK
4248
run: ./gradlew assemble
4349

44-
- name: Upload APK
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: app.apk
48-
path: app/build/outputs/apk/release/app-release-unsigned.apk
50+
# - name: Upload APK
51+
# uses: actions/upload-artifact@v4
52+
# with:
53+
# name: app.apk
54+
# path: app/build/outputs/apk/release/app-release.apk
4955

5056
- name: Release
5157
uses: softprops/action-gh-release@v2
5258
with:
5359
files: |
54-
app/build/outputs/apk/release/app-release-unsigned.apk
60+
app/build/outputs/apk/release/app-release.apk

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ captures/
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16+
keystore.properties
17+
key.jks

app/build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,34 @@ plugins {
55
}
66

77

8+
def keystorePropertiesFile = rootProject.file("app/keystore.properties")
9+
def keystoreProperties = new Properties()
10+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
11+
12+
813
android {
914
namespace 'net.helcel.fidelity'
1015
compileSdk 34
1116

1217
defaultConfig {
1318
applicationId 'net.helcel.fidelity'
14-
resValue "string", "app_name", "Keepass Fideity"
19+
resValue "string", "app_name", "Keepass Fidelity"
1520
minSdk 28
1621
targetSdk 34
1722
versionCode 1
1823
versionName "1.0"
1924
}
2025

26+
27+
signingConfigs {
28+
create("release") {
29+
keyAlias keystoreProperties['keyAlias']
30+
keyPassword keystoreProperties['keyPassword']
31+
storeFile file(keystoreProperties['storeFile'])
32+
storePassword keystoreProperties['storePassword']
33+
}
34+
}
35+
2136
buildTypes {
2237
debug {
2338
debuggable true
@@ -26,6 +41,7 @@ android {
2641
minifyEnabled true
2742
shrinkResources false
2843
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
44+
signingConfig = signingConfigs.getByName("release")
2945
}
3046
}
3147

app/proguard-rules.pro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Gson uses generic type information stored in a class file when working with
2+
# fields. Proguard removes such information by default, keep it.
3+
-keepattributes Signature
4+
5+
# This is also needed for R8 in compat mode since multiple
6+
# optimizations will remove the generic signature such as class
7+
# merging and argument removal. See:
8+
# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson
9+
-keep class com.google.gson.reflect.TypeToken { *; }
10+
-keep class * extends com.google.gson.reflect.TypeToken
11+
12+
# Optional. For using GSON @Expose annotation
13+
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations

0 commit comments

Comments
 (0)