-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action for publishing sdk to maven central
- Loading branch information
1 parent
8f437c6
commit 9247859
Showing
2 changed files
with
95 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish to Maven Central | ||
|
||
on: [ workflow_dispatch ] | ||
|
||
env: | ||
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_SONATYPE_PASSWORD }} | ||
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_SONATYPE_USERNAME }} | ||
JRELEASER_GIT_ROOT_SEARCH: true | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | ||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | ||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version-file: '.java-version' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- name: Java version | ||
run: | | ||
java --version | ||
- run: ./gradlew clean | ||
- run: ./gradlew publish | ||
- run: ./gradlew jreleaserFullRelease |
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 |
---|---|---|
@@ -1,14 +1,21 @@ | ||
plugins { | ||
id("java-library") | ||
id("maven-publish") | ||
id("org.jreleaser") version ("1.14.0") | ||
} | ||
|
||
group = "rs.iggy" | ||
version = "0.0.1-SNAPSHOT" | ||
version = "0.1.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
dependencies { | ||
implementation("org.apache.httpcomponents.client5:httpclient5:5.2.1") | ||
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2") | ||
|
@@ -29,3 +36,61 @@ dependencies { | |
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
artifactId = "iggy-java-sdk" | ||
|
||
from(components["java"]) | ||
|
||
pom { | ||
name = "Iggy Java Client SDK" | ||
description = "Official Java client SDK for Iggy.rs message streaming" | ||
url = "https://github.com/iggy-rs/iggy-java-client" | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "https://github.com/iggy-rs/iggy-java-client/blob/main/LICENSE" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "mmodzelewski" | ||
name = "Maciej Modzelewski" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
url = "https://github.com/iggy-rs/iggy-java-client" | ||
connection = "scm:git:git://github.com/iggy-rs/iggy-java-client.git" | ||
developerConnection = "scm:git:git://github.com/iggy-rs/iggy-java-client.git" | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = uri(layout.buildDirectory.dir("staging-deploy")) | ||
} | ||
} | ||
} | ||
|
||
jreleaser { | ||
signing { | ||
setActive("ALWAYS") | ||
armored = true | ||
} | ||
deploy { | ||
maven { | ||
mavenCentral { | ||
create("sonatype") { | ||
setActive("ALWAYS") | ||
url = "https://central.sonatype.com/api/v1/publisher" | ||
stagingRepository("build/staging-deploy") | ||
} | ||
} | ||
} | ||
} | ||
} |