diff --git a/.github/workflows/release.yaml b/.github/workflows/android-alpha-release.yaml similarity index 97% rename from .github/workflows/release.yaml rename to .github/workflows/android-alpha-release.yaml index 8c3a1e81..a575a500 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/android-alpha-release.yaml @@ -1,9 +1,9 @@ -name: Deploy Alpha Version +name: Android Alpha Release on: push: tags: - - '*' + - '*-android' jobs: deploy: diff --git a/.github/workflows/desktop-release.yaml b/.github/workflows/desktop-release.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/ios-alpha-release.yaml b/.github/workflows/ios-alpha-release.yaml new file mode 100644 index 00000000..e69de29b diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 86eccbe1..6d00b505 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -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() -} \ No newline at end of file + return outputStream.toString() + .trim() + .replace("-android", "") +} diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts index 2147d240..94dce0c0 100644 --- a/desktopApp/build.gradle.kts +++ b/desktopApp/build.gradle.kts @@ -1,4 +1,3 @@ -import org.jetbrains.compose.compose import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { @@ -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) @@ -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." @@ -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) @@ -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", "") +} diff --git a/release.sh b/release.sh new file mode 100755 index 00000000..d3d555f8 --- /dev/null +++ b/release.sh @@ -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 \ No newline at end of file