forked from mysticfall/kotlin-react-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add settings for publishing to OSSRH
- Loading branch information
1 parent
8ea0695
commit 1cafb03
Showing
2 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import org.gradle.api.artifacts.repositories.PasswordCredentials | ||
|
||
plugins { | ||
kotlin("js") version "1.5.31" | ||
|
||
id("maven-publish") | ||
|
||
signing | ||
} | ||
|
||
group = "io.github.mysticfall" | ||
version = "1.0-SNAPSHOT" | ||
|
||
val isReleasedVersion = !project.version.toString().endsWith("-SNAPSHOT") | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
@@ -41,3 +49,68 @@ kotlin { | |
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("main") { | ||
from(components["kotlin"]) | ||
|
||
artifact(tasks.getByName<Zip>("jsSourcesJar")) | ||
|
||
pom { | ||
name.set("Kotlin API for React Test Renderer") | ||
description.set( | ||
"Kotlin wrapper for React Test Renderer, which can be used " + | ||
"to unit test React components in a Kotlin/JS project." | ||
) | ||
url.set("https://github.com/mysticfall/kotlin-react-test") | ||
|
||
licenses { | ||
license { | ||
name.set("The MIT License") | ||
url.set("https://opensource.org/licenses/MIT") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("mysticfall") | ||
name.set("Xavier Cho") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:git://github.com/mysticfall/kotlin-react-test.git") | ||
developerConnection.set("scm:git:[email protected]:mysticfall/kotlin-react-test.git") | ||
url.set("https://github.com/mysticfall/kotlin-react-test") | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "ossrh" | ||
url = uri( | ||
if (isReleasedVersion) { | ||
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
} else { | ||
"https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
) | ||
|
||
credentials(PasswordCredentials::class) | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
// setRequired({ | ||
// gradle.taskGraph.hasTask("publish") | ||
// }) | ||
|
||
useGpgCmd() | ||
|
||
sign(publishing.publications) | ||
} |