From 874d4d98acd0b5f22e751aac43c8d7ed6da2f557 Mon Sep 17 00:00:00 2001 From: Deftu Date: Fri, 25 Aug 2023 12:29:52 +0200 Subject: Add repository and bump version --- build.gradle.kts | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index d8ccda8..5b28178 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ tasks.withType().configureEach { } group = "com.github.replaymod" -version = "SNAPSHOT" +version = "0.1.0" repositories { mavenCentral() @@ -48,6 +48,39 @@ publishing { from(components["java"]) } } + + val publishingUsername: String? = run { + return@run project.findProperty("deftu.publishing.username")?.toString() ?: System.getenv("DEFTU_PUBLISHING_USERNAME") + } + + val publishingPassword: String? = run { + return@run project.findProperty("deftu.publishing.password")?.toString() ?: System.getenv("DEFTU_PUBLISHING_PASSWORD") + } + + repositories { + mavenLocal() + if (publishingUsername != null && publishingPassword != null) { + fun MavenArtifactRepository.applyCredentials() { + authentication.create("basic") + credentials { + username = publishingUsername + password = publishingPassword + } + } + + maven { + name = "DeftuReleases" + url = uri("https://maven.deftu.xyz/releases") + applyCredentials() + } + + maven { + name = "DeftuSnapshots" + url = uri("https://maven.deftu.xyz/snapshots") + applyCredentials() + } + } + } } tasks.test { -- cgit