Skip to content

Commit

Permalink
refactor: publish 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryJhin committed Aug 12, 2024
1 parent 3903c32 commit 078a12f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ jobs:
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
80 changes: 59 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import java.net.URL
plugins {
kotlin("jvm") version "2.0.0"
id("org.jetbrains.dokka") version "1.9.20"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.jreleaser") version "1.13.1"
`maven-publish`
signing
application
}

application {
applicationName = "java-time-extensions"
}

group = "io.github.harryjhin"
Expand Down Expand Up @@ -35,8 +39,7 @@ tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
documentedVisibilities.set(
setOf(
DokkaConfiguration.Visibility.PUBLIC,
DokkaConfiguration.Visibility.PROTECTED
DokkaConfiguration.Visibility.PUBLIC, DokkaConfiguration.Visibility.PROTECTED
)
)

Expand All @@ -48,6 +51,11 @@ tasks.withType<DokkaTask>().configureEach {
}
}

java {
withJavadocJar()
withSourcesJar()
}

tasks.register<Jar>("dokkaHtmlJar") {
dependsOn(tasks.dokkaHtml)
from(tasks.dokkaHtml.flatMap { it.outputDirectory })
Expand Down Expand Up @@ -83,8 +91,8 @@ publishing {
}
}
scm {
connection.set("scm:git:git://github.com/Hjson/java-time-extensions.git")
developerConnection.set("scm:git:ssh://github.com/Hjson/java-time-extensions.git")
connection.set("scm:git:git://github.com/HarryJhin/java-time-extensions.git")
developerConnection.set("scm:git:ssh://github.com/HarryJhin/java-time-extensions.git")
url.set("https://github.com/HarryJhin/java-time-extensions/tree/master")
}
}
Expand All @@ -101,21 +109,51 @@ publishing {
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
jreleaser {
project {
name = "java-time-extensions"
version = "0.0.1"
copyright = "2024 Harry Jhin"
description = "Java Time Extensions"
website = "harryjhin.github.io/java-time-extensions/"
docsUrl = "harryjhin.github.io/java-time-extensions/"
license = "MIT"
authors = listOf("Harry Jhin")
}
release {
github {
repoOwner = "HarryJhin"
token = System.getenv("GITHUB_TOKEN")
overwrite = true
}
}
distributions {
create("app") {
artifact {
setPath("build/libs/${project.name}-${project.version}.jar")
}
}
}
signing {
setActive("ALWAYS")
armored = true
publicKey = System.getenv("GPG_PUBLIC_KEY")
secretKey = System.getenv("GPG_SECRET_KEY")
passphrase = System.getenv("GPG_PASSPHRASE")
}
deploy {
// version = "0.0.1"
group = "io.github.harryjhin"
maven {
mavenCentral {
create("sonatype") {
setActive("ALWAYS")
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
}
}
}
}
}

signing {
useInMemoryPgpKeys(
System.getenv("GPG_SECRET_KEY"),
System.getenv("GPG_PASSWORD"),
)
sign(publishing.publications)
}

0 comments on commit 078a12f

Please sign in to comment.