Marinara/build.gradle.kts
tueem c241f6b1fe
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 17s
Publish / Gradle-Publish (push) Successful in 6s
Test / Gradle-Test (push) Successful in 13s
enable dev branch publishing
2024-11-20 11:52:41 +01:00

53 lines
1.5 KiB
Plaintext

import java.io.ByteArrayOutputStream
plugins {
`maven-publish`
}
allprojects {
group = "net.tomatentum.Marinara"
version = "1.0.0-RC1" + (if (!project.hasProperty("release")) ("-" + getGitHash()) else "")
description = "A simple but powerful, library-agnostic Discord Interaction Wrapper."
}
subprojects {
apply(plugin = "maven-publish")
apply(plugin = "java-library")
plugins.withType<MavenPublishPlugin> {
publishing {
publications {
create<MavenPublication>("maven") {
if (!project.hasProperty("release"))
artifactId = project.getName() + "-dev"
from(components["java"])
}
}
repositories {
maven {
name = "Gitea"
url = uri("https://git.tomatentum.net/api/packages/tueem/maven/")
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token " + System.getenv("GITEA_TOKEN")
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
}
}
}
fun getGitHash(): String {
val output = ByteArrayOutputStream()
project.exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = output
}
return output.toString().trim()
}