diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c74124d..ee22416 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,15 +1,12 @@ -name: Build, Test, Release +name: Release on: workflow_dispatch: - push: - branches: [ "main" ] - paths-ignore: - - 'README.md' jobs: publish: runs-on: nautilus-build + environment: release permissions: actions: read checks: write diff --git a/build-logic/android-library/src/main/kotlin/AndroidLibraryReleasePlugin.kt b/build-logic/android-library/src/main/kotlin/AndroidLibraryReleasePlugin.kt index 93e7418..f1f1ad6 100644 --- a/build-logic/android-library/src/main/kotlin/AndroidLibraryReleasePlugin.kt +++ b/build-logic/android-library/src/main/kotlin/AndroidLibraryReleasePlugin.kt @@ -10,8 +10,6 @@ import org.gradle.kotlin.dsl.provideDelegate import org.gradle.kotlin.dsl.register import org.gradle.plugins.signing.SigningExtension import java.io.File -import java.nio.charset.Charset -import java.util.Base64 import java.util.Properties class AndroidLibraryReleasePlugin : Plugin { @@ -46,20 +44,19 @@ private fun Project.setupReleaseBuild() { private fun Project.setupVersionInfo() { val versionProperties = File(project.rootDir, "version.properties") - println("version properties: $versionProperties") versionProperties.inputStream().use { inputStream -> Properties().apply { load(inputStream) - project.version = getVersionCode() + project.version = getVersionName() } } } -private fun Properties.getVersionCode(): Int { +private fun Properties.getVersionName(): String { val major = (get("majorVersion") as String).toInt() val minor = (get("minorVersion") as String).toInt() val patch = (get("patchVersion") as String).toInt() - return major * 10000 + minor * 100 + patch + return "$major.$minor.$patch" } private fun Project.setupPublishing(): Publication { @@ -68,7 +65,7 @@ private fun Project.setupPublishing(): Publication { register("release") { groupId = "de.sipgate" artifactId = project.name - version = "0.1" + version = project.version.toString() setPom() diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..0324c55 --- /dev/null +++ b/version.properties @@ -0,0 +1,4 @@ +majorVersion=0 +minorVersion=0 +patchVersion=0 +buildNumber= \ No newline at end of file