Skip to content

Commit

Permalink
CI Signing
Browse files Browse the repository at this point in the history
  • Loading branch information
soraefir committed Mar 24, 2024
1 parent 517f024 commit 796c76f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:

steps:
- uses: actions/checkout@v4
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > keystore.asc
echo "${{ secrets.RELEASE_KEY}}" > key.acs
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch keystore.asc > app/keystore.properties
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch key.asc > app/key.jks
- uses: gradle/wrapper-validation-action@v2

- name: create and checkout branch
Expand All @@ -41,14 +47,14 @@ jobs:
- name: Build APK
run: ./gradlew assemble

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app.apk
path: app/build/outputs/apk/release/app-release-unsigned.apk
# - name: Upload APK
# uses: actions/upload-artifact@v4
# with:
# name: app.apk
# path: app/build/outputs/apk/release/app-release.apk

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
app/build/outputs/apk/release/app-release-unsigned.apk
app/build/outputs/apk/release/app-release.apk
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ captures/
.externalNativeBuild
.cxx
local.properties
keystore.properties
key.jks
18 changes: 17 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,34 @@ plugins {
}


def keystorePropertiesFile = rootProject.file("app/keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))


android {
namespace 'net.helcel.fidelity'
compileSdk 34

defaultConfig {
applicationId 'net.helcel.fidelity'
resValue "string", "app_name", "Keepass Fideity"
resValue "string", "app_name", "Keepass Fidelity"
minSdk 28
targetSdk 34
versionCode 1
versionName "1.0"
}


signingConfigs {
create("release") {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
debug {
debuggable true
Expand All @@ -26,6 +41,7 @@ android {
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig = signingConfigs.getByName("release")
}
}

Expand Down
13 changes: 13 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Gson uses generic type information stored in a class file when working with
# fields. Proguard removes such information by default, keep it.
-keepattributes Signature

# This is also needed for R8 in compat mode since multiple
# optimizations will remove the generic signature such as class
# merging and argument removal. See:
# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken

# Optional. For using GSON @Expose annotation
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations

0 comments on commit 796c76f

Please sign in to comment.