-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release package to Gradle public registry, remove support for GitHub …
…packages
- Loading branch information
Showing
2 changed files
with
76 additions
and
18 deletions.
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 |
---|---|---|
|
@@ -3,12 +3,14 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
plugins { | ||
kotlin("jvm") version "1.6.10" | ||
|
||
// https://github.com/gradle-nexus/publish-plugin | ||
id("io.github.gradle-nexus.publish-plugin") version "1.1.0" | ||
id("maven-publish") | ||
id("signing") | ||
} | ||
|
||
group = "com.goforboom" | ||
version = "0.0.1" | ||
|
||
group = "com.goforboom.hubspot" | ||
version = "1.0.0" | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_11 | ||
java.targetCompatibility = JavaVersion.VERSION_11 | ||
|
@@ -33,27 +35,78 @@ dependencies { | |
testImplementation("org.mockito.kotlin:mockito-kotlin:3.2.0") | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
signing { | ||
val signingKey: String = System.getenv("GRADLE_GPG_SIGN_KEY") | ||
val signingPassword: String = System.getenv("GRADLE_GPG_SIGN_PASSWORD") | ||
|
||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
|
||
sign(publishing.publications) | ||
} | ||
|
||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("kotlin") { | ||
groupId = "com.goforboom" | ||
artifactId = "hubspot" | ||
create<MavenPublication>("sdk") { | ||
groupId = "com.goforboom.hubspot" | ||
artifactId = "sdk" | ||
version = version | ||
|
||
pom { | ||
version = version | ||
name.set("HubSpot SDK") | ||
description.set("Implementation of HubSpot API for Java/Kotlin in tiny SDK") | ||
url.set("https://github.com/goforboom/hubspot") | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("goforboom") | ||
name.set("BOOM") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:git://github.com:goforboom/hubspot.git") | ||
developerConnection.set("scm:git:ssh://github.com:goforboom/hubspot.git") | ||
url.set("https://github.com/goforboom/hubspot") | ||
} | ||
} | ||
|
||
from(components["java"]) | ||
} | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
maven { | ||
name = "goforboom" | ||
url = uri("https://maven.pkg.github.com/goforboom/hubspot") | ||
credentials { | ||
|
||
// Credentials for GitHub package publish | ||
username = System.getenv("GITHUB_USERNAME") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
create("sdk") { | ||
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") | ||
) | ||
} | ||
} | ||
} | ||
|