add plugin library publish

This commit is contained in:
2024-10-31 15:02:31 +00:00
parent ecb195d2bc
commit 1296ad5d0e
3 changed files with 32 additions and 0 deletions

View File

@@ -39,6 +39,12 @@ id `ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest`
Extend manifest in library jar file.
### Plugin Library publish
id `ltd.hlaeja.plugin.hlaeja-common-plugin.library-publish`
Configuration for publishing project artifacts to a remote Maven repository.
## Releasing plugin
Run `release.sh` script from `master` branch.

View File

@@ -0,0 +1,25 @@
import java.lang.System.getenv
plugins {
`maven-publish`
}
publishing {
repositories {
fun retrieveConfiguration(
property: String,
environment: String,
): String? = project.findProperty(property)?.toString() ?: getenv(environment)
maven {
url = uri("https://maven.pkg.github.com/swordsteel/${project.name}")
name = "GitHubPackages"
credentials {
username = retrieveConfiguration("repository.user", "REPOSITORY_USER")
password = retrieveConfiguration("repository.token", "REPOSITORY_TOKEN")
}
}
}
publications.register("mavenJava", MavenPublication::class) { from(components["java"]) }
}

View File

@@ -3,6 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("ltd.hlaeja.plugin.hlaeja-common-plugin.common")
id("ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest")
id("ltd.hlaeja.plugin.hlaeja-common-plugin.library-publish")
id("org.springframework.boot")
}