Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Decode Keystore
id: decode_keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks
echo "KEYSTORE_PATH=keystore.jks" >> $GITHUB_ENV

- name: Build Release APK
run: ./gradlew assembleRelease
env:
# These will be needed in build.gradle.kts to sign the APK
# If not provided, it will still build an unsigned APK
KEYSTORE_PATH: ${{ env.KEYSTORE_PATH }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: app/build/outputs/apk/release/app-release-unsigned.apk # Default if not signed
# If signed, the path might be app-release.apk
# We can use a wildcard to be safe
# files: app/build/outputs/apk/release/*.apk
files: app/build/outputs/apk/release/*.apk
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 15 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ android {

signingConfigs {
create("release") {
// Preuzimanje podataka iz Environment varijabli (za GitHub Actions)
// ili korišćenje lokalnih vrednosti ako postoje
storeFile = file(System.getenv("KEYSTORE_PATH") ?: "keystore.jks")
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEY_ALIAS")
keyPassword = System.getenv("KEY_PASSWORD")
val path = System.getenv("KEYSTORE_PATH") ?: "keystore.jks"
val ksFile = file(path)

// Use release signing only if the file exists and parameters are provided
if (ksFile.exists()) {
storeFile = ksFile
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEY_ALIAS")
keyPassword = System.getenv("KEY_PASSWORD")
}
}
}

Expand All @@ -37,9 +41,11 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
// Koristi release potpisivanje samo ako su parametri dostupni
if (System.getenv("KEYSTORE_PASSWORD") != null) {
signingConfig = signingConfigs.getByName("release")

// Set signingConfig only if parameters are actually loaded
val releaseConfig = signingConfigs.getByName("release")
if (releaseConfig.storeFile?.exists() == true) {
signingConfig = releaseConfig
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_cyber_logo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:strokeLineCap="round"
android:strokeLineJoin="round" />

<!-- ABC Letters Stilizovane -->
<!-- ABC Letters Stylized -->
<!-- Letter A -->
<path
android:pathData="M28,68 L36,42 L44,68"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:strokeLineCap="round"
android:strokeLineJoin="round" />

<!-- ABC Letters Stilizovane -->
<!-- ABC Letters Stylized -->
<!-- Letter A -->
<path
android:pathData="M28,68 L36,42 L44,68"
Expand Down
Loading