diff --git a/build.gradle b/build.gradle index 04e389e..9cfeb34 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java' id 'jacoco' + id 'maven-publish' } wrapper { @@ -47,3 +48,33 @@ jacocoTestReport { })) } } + +publishing { + publications { + mavenBinary(MavenPublication) { + groupId = project.group + artifactId = project.name + version = project.version + + from components.java + } + } + + repositories { + maven { + name = 'Di9' + url = uri('https://di9.ru/git/api/packages/Minecraft/maven') + def giteaToken = System.getenv("GITEA_TOKEN") + + credentials(HttpHeaderCredentials) { + name = 'Authorization' + value = "token ${giteaToken}" + } + + authentication { + header(HttpHeaderAuthentication) + } + } + } +} +