Skip to content

Commit 89a85a2

Browse files
Added desktop config to the new app module,
Added build.yml, so that we can manually build artifacts Signed-off-by: MrBoom <[email protected]>
1 parent eb584e1 commit 89a85a2

File tree

4 files changed

+136
-9
lines changed

4 files changed

+136
-9
lines changed

.github/workflows/build.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Build Awery
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
channel:
7+
description: "Channel"
8+
default: "alpha"
9+
type: choice
10+
options:
11+
- alpha
12+
- beta
13+
- stable
14+
workflow_call:
15+
inputs:
16+
channel:
17+
description: "Channel"
18+
default: "alpha"
19+
type: string
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout Repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup JDK 17
32+
if: ${{ env.SKIP_BUILD != 'true' }}
33+
uses: actions/setup-java@v4
34+
with:
35+
distribution: 'temurin'
36+
java-version: 17
37+
cache: gradle
38+
39+
- name: Grant execute permission for gradlew
40+
run: chmod +x gradlew
41+
42+
- name: Build Mobile Apk
43+
id: build_mobile_apk
44+
run: ./gradlew assemble${{ inputs.channel }}MobileRelease -Pbuildkonfig.flavor=${{ inputs.channel }}
45+
46+
- name: Build TV Apk
47+
id: build_tv_apk
48+
run: ./gradlew assemble${{ inputs.channel }}TvRelease -Pbuildkonfig.flavor=${{ inputs.channel }}
49+
50+
# - name: Build Exe
51+
# id: build_alpha_exe
52+
# run: ./gradlew packageExe -Pbuildkonfig.flavor=${{ inputs.channel }}
53+
54+
- name: Sign Mobile Apk
55+
if: success()
56+
uses: r0adkll/sign-android-release@v1
57+
with:
58+
releaseDirectory: app/build/outputs/apk/${{ inputs.channel }}Mobile/release
59+
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
60+
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
61+
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
62+
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
63+
env:
64+
BUILD_TOOLS_VERSION: "34.0.0"
65+
66+
- name: Sign Tv Apk
67+
if: success()
68+
uses: r0adkll/sign-android-release@v1
69+
with:
70+
releaseDirectory: app/build/outputs/apk/${{ inputs.channel }}Tv/release
71+
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
72+
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
73+
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
74+
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
75+
env:
76+
BUILD_TOOLS_VERSION: "34.0.0"
77+
78+
- name: Rename Mobile Apk File
79+
run: |
80+
mv app/build/outputs/apk/${{ inputs.channel }}Mobile/release/app-${{ inputs.channel }}-mobile-release-signed.apk app/build/outputs/apk/${{ inputs.channel }}Mobile/release/awery-mobile-${{ inputs.channel }}.apk
81+
82+
- name: Rename Tv Apk File
83+
run: |
84+
mv app/build/outputs/apk/${{ inputs.channel }}Tv/release/app-${{ inputs.channel }}-tv-release-signed.apk app/build/outputs/apk/${{ inputs.channel }}Tv/release/awery-tv-${{ inputs.channel }}.apk
85+
86+
- name: Upload Mobile Apk
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: "Mobile Apk"
90+
retention-days: 90
91+
path: "app/build/outputs/apk/${{ inputs.channel }}Mobile/release/awery-mobile-${{ inputs.channel }}.apk"
92+
93+
- name: Upload Tv Apk
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: "Tv Apk"
97+
retention-days: 90
98+
path: "app/build/outputs/apk/${{ inputs.channel }}Tv/tv/release/awery-tv-${{ inputs.channel }}.apk"

.github/workflows/publish_alpha.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ on:
88
- "docs/**"
99
- "README.md"
1010
- "LICENSE.md"
11-
- ".github/workflows/bug_greetings.yml"
12-
- ".github/workflows/feature_greetings.yml"
13-
- ".github/workflows/pr_greetings.yml"
14-
- ".github/workflows/test_build.yml"
15-
- ".github/ISSUE_TEMPLATE/config.yml"
16-
- ".github/ISSUE_TEMPLATE/report_issue.yml"
17-
- ".github/ISSUE_TEMPLATE/request_feature.yml"
11+
- ".github/**"
12+
- ".run/**"
1813

1914
jobs:
2015
build:
@@ -91,7 +86,7 @@ jobs:
9186

9287
# - name: Build Alpha EXE
9388
# id: build_alpha_exe
94-
# run: ./gradlew someGradleTaskToAssembleAnExeFileIdk -Pbuildkonfig.flavor=alpha
89+
# run: ./gradlew packageExe -Pbuildkonfig.flavor=alpha
9590

9691
- name: Sign Alpha APK
9792
if: success()

app/build.gradle.kts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
import com.android.build.api.dsl.ApplicationProductFlavor
2+
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
33
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
44

55
plugins {
@@ -189,6 +189,32 @@ composeCompiler {
189189
"compose-stability.txt"))
190190
}
191191

192+
compose.desktop {
193+
application {
194+
mainClass = "com.mrboomdev.awery.MainKt"
195+
196+
nativeDistributions {
197+
targetFormats(TargetFormat.Exe, TargetFormat.Deb, TargetFormat.Msi)
198+
packageName = "com.mrboomdev.awery"
199+
200+
packageVersion = properties["awery.app.version"].toString().split(".").let { args ->
201+
return@let "${args[0]}.${args[1]}.${args[2]}" + args.getOrNull(3).let { thirdArg ->
202+
thirdArg ?: ""
203+
}
204+
}
205+
206+
windows {
207+
console = true
208+
perUserInstall = true
209+
menu = true
210+
menuGroup = "Awery"
211+
includeAllModules = true
212+
upgradeUuid = "6a7f9795-c323-4c10-a73a-55ac5506af01"
213+
}
214+
}
215+
}
216+
}
217+
192218
compose.resources {
193219
generateResClass = never
194220
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.mrboomdev.awery
2+
3+
import kotlin.system.exitProcess
4+
5+
fun main() {
6+
println("This shit isn't done yet!")
7+
exitProcess(0)
8+
}

0 commit comments

Comments
 (0)