Skip to content

Commit 46d2e39

Browse files
committed
Fix: Update Gradle task and artifact paths for release build
1 parent 0ceaec6 commit 46d2e39

File tree

3 files changed

+63
-13
lines changed

3 files changed

+63
-13
lines changed

.github/workflows/release-build.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,25 @@ jobs:
3333
run: chmod +x gradlew
3434

3535
# Step 4: Build the app
36-
# This runs the Gradle task to create the native installer package.
3736
- name: Build with Gradle
38-
run: ./gradlew createReleaseDistributable
37+
run: ./gradlew packageReleaseDistribution
3938

4039
# Step 5: Upload the generated installer to the release
4140
- name: Upload Release Artifact
4241
uses: actions/upload-release-asset@v1
4342
with:
44-
# This is a secret token that GitHub Actions provides automatically.
45-
# It gives the workflow permission to upload files to your release.
4643
github_token: ${{ secrets.GITHUB_TOKEN }}
47-
48-
# This is the URL for the release that triggered the workflow.
4944
upload_url: ${{ github.event.release.upload_url }}
5045

51-
# Find the correct asset path based on the OS.
52-
# The '**' is a wildcard that finds the file regardless of its exact name.
46+
# The path now correctly points to the final installer files.
5347
asset_path: |
54-
${{ matrix.os == 'windows-latest' && format('{0}/shared/build/compose/binaries/main/dist/*.msi', github.workspace) || '' }}
55-
${{ matrix.os == 'macos-latest' && format('{0}/shared/build/compose/binaries/main/dist/*.dmg', github.workspace) || '' }}
56-
${{ matrix.os == 'ubuntu-latest' && format('{0}/shared/build/compose/binaries/main/dist/*.deb', github.workspace) || '' }}
48+
${{ matrix.os == 'windows-latest' && format('{0}/shared/build/compose/binaries/main-release/msi/*.msi', github.workspace) || '' }}
49+
${{ matrix.os == 'macos-latest' && format('{0}/shared/build/compose/binaries/main-release/dmg/*.dmg', github.workspace) || '' }}
50+
${{ matrix.os == 'ubuntu-latest' && format('{0}/shared/build/compose/binaries/main-release/deb/*.deb', github.workspace) || '' }}
5751
58-
# This is the name the file will have on the release page.
5952
asset_name: |
6053
${{ matrix.os == 'windows-latest' && 'AgeCalculator-windows-installer.msi' || '' }}
6154
${{ matrix.os == 'macos-latest' && 'AgeCalculator-macOS-installer.dmg' || '' }}
6255
${{ matrix.os == 'ubuntu-latest' && 'AgeCalculator-linux-installer.deb' || '' }}
6356
64-
asset_content_type: application/octet-stream
57+
asset_content_type: application/octet-stream

shared/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,18 @@ compose.desktop {
110110
}
111111
windows {
112112
iconFile.set(project.file("app_icon.ico"))
113+
menuGroup = "Age Calculator"
114+
shortcut = true
113115
}
114116
linux {
115117
iconFile.set(project.file("app_icon.png"))
116118
}
117119
}
120+
121+
buildTypes.release.proguard {
122+
isEnabled.set(true)
123+
configurationFiles.from("compose-desktop.pro")
124+
}
118125
}
119126
}
120127

shared/compose-desktop.pro

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This rule tells ProGuard to keep the main entry point of your application.
2+
-keep public class com.synac.agecalculator.MainKt {
3+
public static void main(java.lang.String[]);
4+
}
5+
6+
# --- Suppress Warnings for Missing or Unresolved Classes ---
7+
-dontwarn kotlin.jvm.internal.EnhancedNullability
8+
-dontwarn kotlin.concurrent.atomics.**
9+
-dontwarn okio.**
10+
-dontwarn java.lang.Thread$Builder**
11+
12+
13+
# --- Rules for Application Code ---
14+
# It tells ProGuard to keep all of our application's own classes.
15+
-keep class com.synac.agecalculator.** { *; }
16+
17+
18+
# --- Rules for Koin (Dependency Injection) ---
19+
# These rules are still good practice to have.
20+
-keep class org.koin.** { *; }
21+
22+
23+
# --- Rules for Room (Database) ---
24+
# This prevents ProGuard from removing the classes that Room generates.
25+
-keep class androidx.room.** { *; }
26+
-keepclassmembers class **.database.*_Impl { *; }
27+
-keepclassmembers class **.dao.*_Impl { *; }
28+
29+
30+
# --- Rules for Kotlinx Serialization ---
31+
-keep @kotlinx.serialization.Serializable class * { *; }
32+
-keep class **$$serializer { *; }
33+
-keep class kotlinx.serialization.internal.* { *; }
34+
35+
36+
# --- Rules for Kotlinx Coroutines ---
37+
-keep class kotlinx.coroutines.internal.MainDispatcherFactory { *; }
38+
-keep class kotlinx.coroutines.swing.SwingDispatcherFactory { *; }
39+
40+
41+
# --- General Rules for Kotlin ---
42+
-keep class kotlin.reflect.jvm.internal.** { *; }
43+
-dontwarn kotlin.reflect.jvm.internal.**
44+
-keep class kotlin.Metadata
45+
-keep class kotlin.coroutines.jvm.internal.DebugMetadata { *; }
46+
47+
48+
# --- Rule for Duplicate Definitions ---
49+
-dontwarn **.module-info
50+

0 commit comments

Comments
 (0)