From ba914d5b6edc8a6b120c003305cca65c2518a9ee Mon Sep 17 00:00:00 2001 From: Syrent Date: Sun, 2 Jun 2024 13:48:52 +0330 Subject: [PATCH] [ci skip] ci: change version scheme for snapshot builds --- build.gradle.kts | 14 ++++---------- gradle.properties | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4b2d6224..f8efcf53 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,13 +31,7 @@ fun latestCommitMessage(): String { val versionString: String = findProperty("version")!! as String val isRelease: Boolean = (System.getenv("HANGAR_BUILD_CHANNEL") ?: "Snapshot") == "Release" -val suffixedVersion: String = if (isRelease) { - versionString -} else { - "$versionString-SNAPSHOT" -} - -val publishVersion = if (isRelease) suffixedVersion else "$versionString-build.${System.getenv("GITHUB_RUN_NUMBER")}" +val publishVersion = if (isRelease) versionString else "$versionString-build.${System.getenv("GITHUB_RUN_NUMBER")}" val commitVersion = publishVersion + "-" + (System.getenv("GITHUB_SHA")?.substring(0, 7) ?: "local") version = commitVersion @@ -131,7 +125,7 @@ subprojects { create("maven") { shadow.component(this) artifact(tasks["sourcesJar"]) - this.version = suffixedVersion + this.version = versionString setPom(this) } } @@ -178,7 +172,7 @@ fun setPom(publication: MavenPublication) { hangarPublish { publications.register("plugin") { - version.set(if (isRelease) suffixedVersion else publishVersion) + version.set(if (isRelease) versionString else publishVersion) channel.set(System.getenv("HANGAR_BUILD_CHANNEL") ?: "Snapshot") changelog.set(if (System.getenv("HANGAR_CHANGELOG").isNullOrEmpty()) changelogContent else System.getenv("HANGAR_CHANGELOG")) id.set(slug) @@ -209,7 +203,7 @@ modrinth { token.set(modrinthApiKey) projectId.set("${property("modrinthProjectID")}") - versionNumber.set(if (isRelease) suffixedVersion else publishVersion) + versionNumber.set(if (isRelease) versionString else publishVersion) versionType.set(System.getenv("MODRINTH_BUILD_CHANNEL") ?: "beta") uploadFile.set(project(":sayanvanish-bukkit").tasks.shadowJar.flatMap { it.archiveFile }) additionalFiles.set(listOf( diff --git a/gradle.properties b/gradle.properties index d167c9ac..0746ae78 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,4 +30,4 @@ description=A modular vanish system for Minecraft servers website=https://sayandev.org author=Syrent -version=1.0.0-rc.7 \ No newline at end of file +version=1.0.0-rc.8-SNAPSHOT \ No newline at end of file