Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #35

Merged
merged 1 commit into from
Jan 14, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
./gradlew --parallel --no-daemon publish
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
env:
SONATYPE_USERNAME: ${{ secrets.PRELUDE_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.PRELUDE_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.1"
".": "0.1.0-beta.1"
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/so.prelude.sdk/prelude-java)](https://central.sonatype.com/artifact/so.prelude.sdk/prelude-java/0.1.0-alpha.1)
[![Maven Central](https://img.shields.io/maven-central/v/so.prelude.sdk/prelude-java)](https://central.sonatype.com/artifact/so.prelude.sdk/prelude-java/0.1.0-beta.1)

<!-- x-release-please-end -->

Expand All @@ -27,7 +27,7 @@ The REST API documentation can be found on [docs.prelude.so](https://docs.prelu
<!-- x-release-please-start-version -->

```kotlin
implementation("so.prelude.sdk:prelude-java:0.1.0-alpha.1")
implementation("so.prelude.sdk:prelude-java:0.1.0-beta.1")
```

#### Maven
Expand All @@ -36,7 +36,7 @@ implementation("so.prelude.sdk:prelude-java:0.1.0-alpha.1")
<dependency>
<groupId>so.prelude.sdk</groupId>
<artifactId>prelude-java</artifactId>
<version>0.1.0-alpha.1</version>
<version>0.1.0-beta.1</version>
</dependency>
```

Expand Down
18 changes: 1 addition & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

allprojects {
group = "so.prelude.sdk"
version = "0.1.0-alpha.1" // x-release-please-version
}

nexusPublishing {
repositories {
sonatype {
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"))
}
}
version = "0.1.0-beta.1" // x-release-please-version
}
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "1.9.22"
id("com.vanniktech.maven.publish") version "0.28.0"
}

repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
9 changes: 0 additions & 9 deletions buildSrc/src/main/kotlin/prelude.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ repositories {
mavenCentral()
}

configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}

configure<SpotlessExtension> {
java {
importOrder()
Expand All @@ -35,10 +30,6 @@ tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}

tasks.named<Jar>("javadocJar") {
setZip64(true)
}

tasks.named<Jar>("jar") {
manifest {
attributes(mapOf(
Expand Down
92 changes: 39 additions & 53 deletions buildSrc/src/main/kotlin/prelude.publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,61 +1,47 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`maven-publish`
signing
id("com.vanniktech.maven.publish")
}

repositories {
gradlePluginPortal()
mavenCentral()
}

configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
from(components["java"])

pom {
name.set("Prelude API")
description.set("The Prelude API allows you to send messages to your users.")
url.set("https://docs.prelude.so")

licenses {
license {
name.set("Apache-2.0")
}
}

developers {
developer {
name.set("Prelude")
email.set("[email protected]")
}
}

scm {
connection.set("scm:git:git://github.com/prelude-so/java-sdk.git")
developerConnection.set("scm:git:git://github.com/prelude-so/java-sdk.git")
url.set("https://github.com/prelude-so/java-sdk")
}

versionMapping {
allVariants {
fromResolutionResult()
}
}
extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")

configure<MavenPublishBaseExtension> {
signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

coordinates(project.group.toString(), project.name, project.version.toString())

pom {
name.set("Prelude API")
description.set("The Prelude API allows you to send messages to your users.")
url.set("https://docs.prelude.so")

licenses {
license {
name.set("Apache-2.0")
}
}
}
}

signing {
val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(
signingKeyId,
signingKey,
signingPassword,
)
sign(publishing.publications["maven"])
}
}
developers {
developer {
name.set("Prelude")
email.set("[email protected]")
}
}

tasks.named("publish") {
dependsOn(":closeAndReleaseSonatypeStagingRepository")
scm {
connection.set("scm:git:git://github.com/prelude-so/java-sdk.git")
developerConnection.set("scm:git:git://github.com/prelude-so/java-sdk.git")
url.set("https://github.com/prelude-so/java-sdk")
}
}
}