Skip to content

Commit

Permalink
fix publishing section in build.gradle (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 authored Dec 13, 2024
1 parent cce5ec0 commit afbf718
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ossrhPassword=<token>
- Update `dgraph4j version` in `grpc-netty` table in README.
- Update CHANGELOG.
- Raise a PR for the above changes. Put the changelog in PR description and merge it.
- Run `./gradlew publishAllPublicationsToMavenRepository`.
- Run `./gradlew publishMavenJavaPublicationToMavenRepository`.
- Release the deployment by following the steps on the page _Releasing the Deployment_ (link in references below).
- Also cut a release tag on GitHub with the new version.

Expand Down
20 changes: 14 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ jacocoTestReport {
}

if (project.hasProperty('ossrhUsername')) {
signing {
sign configurations.archives
}

publishing {
java {
withSourcesJar()
withJavadocJar()
}

repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username = ossrhUsername
Expand All @@ -248,8 +248,12 @@ if (project.hasProperty('ossrhUsername')) {
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}

publications {
mavenJava(MavenPublication) {
artifactId = 'dgraph4j'
from components.java

pom {
name = 'dgraph4j'
description = 'Dgraph Java Client'
Expand All @@ -264,7 +268,7 @@ if (project.hasProperty('ossrhUsername')) {
developers {
developer {
name = 'Dgraph Labs'
email = 'helo@hypermode.com'
email = 'hello@hypermode.com'
}
}
scm {
Expand All @@ -275,6 +279,10 @@ if (project.hasProperty('ossrhUsername')) {
}
}
}

signing {
sign publishing.publications.mavenJava
}
}

task version {
Expand Down

0 comments on commit afbf718

Please sign in to comment.