add package uploading

This commit is contained in:
2025-01-24 02:45:26 +02:00
parent 1e982cd2ef
commit 6125772038
9 changed files with 39 additions and 10 deletions

View File

@@ -9,4 +9,7 @@ java {
toolchain {
languageVersion = JavaLanguageVersion.of(17);
}
withJavadocJar();
withSourcesJar();
}

View File

@@ -1,5 +1,6 @@
plugins {
id("java");
id("maven-publish");
}
version = rootProject.version;
@@ -20,3 +21,27 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2");
testRuntimeOnly("org.junit.platform:junit-platform-launcher");
}
publishing {
repositories {
maven {
name = "Gitea";
url = uri(System.getenv("REPO_URL") ?: "");
credentials(HttpHeaderCredentials::class) {
name = "Authorization";
value = "token ${System.getenv("ACCESS_TOKEN")}";
}
authentication {
create<HttpHeaderAuthentication>("header");
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"]);
}
}
}