Add publish step
Some checks failed
Build with cached gradle / Build-with-gradle (pull_request) Failing after 2m43s
Java Google Checkstyle / Checkstyle Linter (pull_request) Successful in 16s

This commit is contained in:
2026-01-24 00:37:54 -06:00
parent bddcc273cf
commit ebdc03b0b4
2 changed files with 55 additions and 1 deletions

View File

@@ -16,3 +16,4 @@ jobs:
# sub-project/*.gradle*
# sub-project/**/gradle-wrapper.properties
- run: ./gradlew build --no-daemon
- run: ./gradlew publishAllPublicationsToGiteaRepository -PgradleKey="${{ secrets.GRADLE_KEY }}"

View File

@@ -1,12 +1,65 @@
plugins {
id("java")
`maven-publish`
// Also commonly used for creating source/javadoc JARs
id("org.jetbrains.dokka") version "1.9.20"
}
group = "com.softwaresmyth"
version = "1.0-SNAPSHOT"
val mySecret = project.findProperty("mySecretProperty")
publishing {
// Define a publication, in this case for Maven
publications {
// other settings of publication
repositories {
maven {
name = "Gitea"
url = uri("https://gitea.example.com/api/packages/numbers/maven")
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token $mySecret"
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
create<MavenPublication>("Smythery") {
// Specify which component to publish (usually "java" for a standard library)
from(components["java"])
// Optional: Customize POM metadata (required for Maven Central)
pom {
name = "Ornot"
description = "A library of methods that do nothing"
url = "https://gitea.softwaresmyth.com/numbers/Ornot"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "Numbers"
name = "Josh Chester"
}
}
}
}
}
}
repositories {
mavenCentral()
// other repositories
maven { url = uri("https://gitea.softwaresmyth.com/api/packages/numbers/maven") }
}
dependencies {