Skip to content

Commit a88681a

Browse files
chore: switch to com.vanniktech.maven.publish for publishing
1 parent 2e6eab2 commit a88681a

File tree

2 files changed

+34
-51
lines changed

2 files changed

+34
-51
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
8181
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
8282
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
83-
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
83+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
8484
run: |
8585
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
8686
@@ -90,7 +90,7 @@ jobs:
9090
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
9191
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
9292
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
93-
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
93+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
9494
run: ./gradlew closeAndReleaseRepository
9595

9696
- uses: DevCycleHQ/release-action/create-release@v2.3.0

build.gradle

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ plugins {
44
id 'de.undercouch.download' version '5.5.0'
55
id 'java'
66
id 'java-library'
7-
id 'maven-publish'
87
id 'signing'
98
id "com.google.protobuf" version "0.9.4"
10-
id "io.github.gradle-nexus.publish-plugin" version "1.3.0" apply(false)
9+
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
10+
id "com.vanniktech.maven.publish" version "0.30.0"
1111
}
1212

1313
if (project == rootProject) {
@@ -33,41 +33,38 @@ group = "com.devcycle"
3333
archivesBaseName = "java-server-sdk"
3434
version = "2.4.0"
3535

36-
publishing {
37-
publications {
38-
mavenJava(MavenPublication) {
39-
from(components.java)
40-
41-
pom {
42-
name = 'DevCycle Java Server SDK'
43-
packaging = 'jar'
44-
artifactId = 'java-server-sdk'
45-
description = 'Server side SDK to interact with DevCycle.'
46-
url = 'https://devcycle.com'
47-
48-
scm {
49-
connection = 'scm:git:git://github.com/DevCycleHQ/java-server-sdk.git'
50-
developerConnection = 'scm:git:ssh://github.com:DevCycleHQ/java-server-sdk.git'
51-
url = 'https://github.com/DevCycleHQ/java-server-sdk'
52-
}
53-
54-
licenses {
55-
license {
56-
name = 'MIT License'
57-
url = 'https://www.opensource.org/licenses/mit-license.php'
58-
}
59-
}
60-
61-
developers {
62-
developer {
63-
id = 'devcycle'
64-
name = 'DevCycle Engineering'
65-
email = 'support@devcycle.com'
66-
organization = 'DevCycle'
67-
}
68-
}
36+
mavenPublishing {
37+
coordinates("com.devcycle", "java-server-sdk", version)
38+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
39+
signAllPublications()
40+
41+
42+
pom {
43+
name = 'DevCycle Java Server SDK'
44+
description = 'Server side SDK to interact with DevCycle.'
45+
url = 'https://devcycle.com'
46+
47+
licenses {
48+
license {
49+
name = 'MIT License'
50+
url = 'https://www.opensource.org/licenses/mit-license.php'
6951
}
7052
}
53+
54+
developers {
55+
developer {
56+
id = 'devcycle'
57+
name = 'DevCycle Engineering'
58+
email = 'support@devcycle.com'
59+
organization = 'DevCycle'
60+
}
61+
}
62+
63+
scm {
64+
connection = 'scm:git:git://github.com/DevCycleHQ/java-server-sdk.git'
65+
developerConnection = 'scm:git:ssh://github.com:DevCycleHQ/java-server-sdk.git'
66+
url = 'https://github.com/DevCycleHQ/java-server-sdk'
67+
}
7168
}
7269
}
7370

@@ -89,20 +86,6 @@ def base64Decode(encodedString){
8986
}
9087
return null;
9188
}
92-
if (project == rootProject) {
93-
nexusPublishing {
94-
// Utilizes the Gradle Nexus Publish Plugin: https://github.com/gradle-nexus/publish-plugin/
95-
// to publish, close and release repositories to Sonatype
96-
repositories {
97-
sonatype {
98-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
99-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
100-
username = findProperty("sonatypeUsername")
101-
password = findProperty("sonatypePassword")
102-
}
103-
}
104-
}
105-
}
10689

10790
repositories {
10891
mavenCentral()

0 commit comments

Comments
 (0)