Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ jobs:

- name: Publish to maven
run: |
./gradlew publish
./gradlew sonatypeCentralUpload
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PUBLISH_REGISTRY_URL: "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
MAVEN_PUBLISH_REGISTRY_URL: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
MAVEN_SIGNATURE_KID: ${{ secrets.MAVEN_SIGNATURE_KID }}
MAVEN_SIGNATURE_SECRET_KEY: ${{ secrets.MAVEN_SIGNATURE_SECRET_KEY }}
MAVEN_SIGNATURE_PASSWORD: ${{ secrets.MAVEN_SIGNATURE_PASSWORD }}
8 changes: 8 additions & 0 deletions .publish/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Write key ring file
echo "$MAVEN_SIGNATURE_SECRET_KEY" > armored_key.asc
gpg -o publish_key.gpg --dearmor armored_key.asc

# Generate gradle.properties file
echo "signing.keyId=$MAVEN_SIGNATURE_KID" > gradle.properties
echo "signing.secretKeyRingFile=publish_key.gpg" >> gradle.properties
echo "signing.password=$MAVEN_SIGNATURE_PASSWORD" >> gradle.properties
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!
On the other hand, contributions to the README are always very welcome!
49 changes: 39 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.11.0'
id 'signing'
id 'cl.franciscosolis.sonatype-central-upload' version '1.0.3'
}

repositories {
mavenCentral()
maven {
url 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}
}

Expand Down Expand Up @@ -59,6 +61,10 @@ javadocJar {
archiveBaseName = "merge-java-client"
}

signing {
sign(publishing.publications)
}

test {
useJUnitPlatform()
testLogging {
Expand All @@ -74,11 +80,20 @@ publishing {
version = '4.0.0'
from components.java
pom {
name = 'merge'
description = 'The official SDK of merge'
url = 'https://buildwithfern.com'
licenses {
license {
name = 'CustomLicense{filename: LICENSE}'
}
}
developers {
developer {
name = 'merge'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/merge-api/merge-java-client.git'
developerConnection = 'scm:git:git://github.com/merge-api/merge-java-client.git'
Expand All @@ -87,14 +102,28 @@ publishing {
}
}
}
repositories {
maven {
url "$System.env.MAVEN_PUBLISH_REGISTRY_URL"
credentials {
username "$System.env.MAVEN_USERNAME"
password "$System.env.MAVEN_PASSWORD"
}
}
}
}

sonatypeCentralUpload {
username = "$System.env.MAVEN_USERNAME"
password = "$System.env.MAVEN_PASSWORD"

archives = files(
"$buildDir/libs/merge-java-client-" + version + ".jar",
"$buildDir/libs/merge-java-client-" + version + "-sources.jar",
"$buildDir/libs/merge-java-client-" + version + "-javadoc.jar"
)

pom = file("$buildDir/publications/maven/pom-default.xml")
signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
signingKeyPassphrase = "$System.env.MAVEN_SIGNATURE_PASSWORD"
}

signing {
def signingKeyId = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
def signingPassword = "$System.env.MAVEN_SIGNATURE_PASSWORD"
useInMemoryPgpKeys(signingKeyId, signingPassword)
sign publishing.publications.maven
}

sonatypeCentralUpload.dependsOn build
Empty file added gradle.properties
Empty file.