Skip to content

Commit

Permalink
Prepare for self signed keys
Browse files Browse the repository at this point in the history
  • Loading branch information
greenart7c3 committed Sep 13, 2024
1 parent 53c8ce2 commit 6c64d68
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 73 deletions.
72 changes: 1 addition & 71 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build AAB
run: ./gradlew clean bundleRelease --stacktrace

- name: Sign AAB
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION: "34.0.0"

- name: Build APK
run: ./gradlew assembleRelease --stacktrace

Expand Down Expand Up @@ -82,60 +67,5 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-universal-release-unsigned-signed.apk
asset_name: citrine-universal-${{ github.ref_name }}.apk
asset_content_type: application/zip

- name: Upload APK x86 Asset
id: upload-release-asset-x86-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-x86-release-unsigned-signed.apk
asset_name: citrine-x86-${{ github.ref_name }}.apk
asset_content_type: application/zip

- name: Upload APK x86_64 Asset
id: upload-release-asset-x86-64-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-x86_64-release-unsigned-signed.apk
asset_name: citrine-x86_64-${{ github.ref_name }}.apk
asset_content_type: application/zip

- name: Upload APK arm64-v8a Asset
id: upload-release-asset-arm64-v8a-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-arm64-v8a-release-unsigned-signed.apk
asset_name: citrine-arm64-v8a-${{ github.ref_name }}.apk
asset_content_type: application/zip

- name: Upload APK armeabi-v7a Asset
id: upload-release-asset-armeabi-v7a-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-armeabi-v7a-release-unsigned-signed.apk
asset_name: citrine-armeabi-v7a-${{ github.ref_name }}.apk
asset_content_type: application/zip

- name: Upload AAB Asset
id: upload-release-asset-aab
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/bundle/release/app-release.aab
asset_name: citrine-${{ github.ref_name }}.aab
asset_name: citrine-fdroid-universal-${{ github.ref_name }}.apk
asset_content_type: application/zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/captures
.cxx
.kotlin/
keystore.properties


# Built application files
Expand Down
22 changes: 22 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.io.FileInputStream
import java.util.Properties
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand Down Expand Up @@ -100,8 +102,28 @@ android {
}
}

if (System.getenv("SIGN_RELEASE") != null) {
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties().apply {
load(FileInputStream(keystorePropertiesFile))
}

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

buildTypes {
release {
if (System.getenv("SIGN_RELEASE") != null) {
signingConfig = signingConfigs.getByName("release")
}

isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xms1024m -Xmx4096m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand All @@ -22,4 +22,4 @@ kotlin.code.style=official
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.enableR8.fullMode=true
android.nonFinalResIds=false
android.nonFinalResIds=false

0 comments on commit 6c64d68

Please sign in to comment.