Skip to content

Commit

Permalink
Start setup release automation for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed Apr 6, 2023
1 parent 558f8ff commit ea9be0c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Deploy Alpha Version
name: Android Alpha Release

on:
push:
tags:
- '*'
- '*-android'

jobs:
deploy:
Expand Down
Empty file.
Empty file.
8 changes: 5 additions & 3 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ fun getVersionCode(): Int {
fun getVersionName(): String {
val outputStream = org.apache.commons.io.output.ByteArrayOutputStream()
project.exec {
commandLine = "git describe --tags --abbrev=0".split(" ")
commandLine = listOf("git", "describe", "--tags", "--abbrev=0", "--match", "*-android")
standardOutput = outputStream
}
return outputStream.toString().trim()
}
return outputStream.toString()
.trim()
.replace("-android", "")
}
29 changes: 25 additions & 4 deletions desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
Expand Down Expand Up @@ -39,7 +38,6 @@ kotlin {
compose.desktop {
application {
mainClass = "com.prof18.feedflow.MainKt"
javaHome = "/Library/Java/JavaVirtualMachines/zulu-18.jdk/Contents/Home"

// buildTypes.release.proguard {
// obfuscate.set(true)
Expand All @@ -51,11 +49,13 @@ compose.desktop {

nativeDistributions {

outputBaseDir.set(project.buildDir.resolve("release"))

modules("java.instrument", "java.sql", "jdk.unsupported")

targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "FeedFlow"
packageVersion = "1.0.0"
packageVersion = getVersionName()

description = "FeedFlow - Read RSS Feed"
copyright = "© 2023 Marco Gomiero. All rights reserved."
Expand All @@ -65,9 +65,10 @@ compose.desktop {
macOS {
iconFile.set(iconsRoot.resolve("icon.icns"))

packageName = "FeedFlow"
bundleID = "com.prof18.feedflow"

entitlementsFile.set(project.file("default.entitlements")) // <----------- this line
entitlementsFile.set(project.file("default.entitlements"))

signing {
sign.set(true)
Expand All @@ -89,3 +90,23 @@ compose.desktop {
}
}
}

fun getVersionCode(): Int {
val outputStream = org.apache.commons.io.output.ByteArrayOutputStream()
project.exec {
commandLine = "git rev-list HEAD --first-parent --count".split(" ")
standardOutput = outputStream
}
return outputStream.toString().trim().toInt()
}

fun getVersionName(): String {
val outputStream = org.apache.commons.io.output.ByteArrayOutputStream()
project.exec {
commandLine = listOf("git", "describe", "--tags", "--abbrev=0", "--match", "*-desktop")
standardOutput = outputStream
}
return outputStream.toString()
.trim()
.replace("-desktop", "")
}
14 changes: 14 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
./gradlew desktopTest

# ./gradlew packageDmg

tag=$(git describe --tags --abbrev=0 --match *-desktop)
version=$(echo "$tag" | sed 's/-desktop$//')
name="FeedFlow-${version}.dmg"

path="desktopApp/build/release/main/dmg/${name}"

#xcrun notarytool submit ${path} --apple-id mgp.dev.studio@gmail.com --password @keychain:NOTARIZATION_PASSWORD --wait

#xcrun stapler staple $path
gh release create $tag $path

0 comments on commit ea9be0c

Please sign in to comment.