From 8635906b1c3d4efd9da6395f1460df32295c86dd Mon Sep 17 00:00:00 2001 From: comp500 Date: Tue, 22 Jun 2021 13:52:30 +0100 Subject: [PATCH] Add maven publishing target --- build.gradle.kts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 08886f9..39fcaaf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,7 @@ plugins { id("com.github.breadmoirai.github-release") version "2.2.12" kotlin("jvm") version "1.4.21" id("com.github.jk1.dependency-license-report") version "1.16" + `maven-publish` } java { @@ -134,4 +135,30 @@ tasks.compileTestKotlin { jvmTarget = "1.8" freeCompilerArgs = listOf("-Xjvm-default=enable", "-Xallow-result-return-type", "-Xopt-in=kotlin.io.path.ExperimentalPathApi") } -} \ No newline at end of file +} + +if (project.hasProperty("bunnycdn.token")) { + publishing { + publications { + create("maven") { + groupId = "link.infra.packwiz" + artifactId = "packwiz-installer" + + from(components["java"]) + } + } + repositories { + maven { + url = uri("https://storage.bunnycdn.com/comp-maven") + credentials(HttpHeaderCredentials::class) { + name = "AccessKey" + value = findProperty("bunnycdn.token") as String? + } + authentication { + create("header") + } + } + } + } +} +