diff --git a/README.md b/README.md index 8947d84..f195540 100644 --- a/README.md +++ b/README.md @@ -37,15 +37,25 @@ To build or test RedPulsar, run the following command: ```bash git clone git@github.com:himadieievsv/redpulsar.git cd redpulsar + # Code formatting ./gradlew ktlintFormat + # Run all tests docker-compose up -d ./gradlew test + # Run only unit tests ./gradlew test -DexcludeTags="integration" -# Build and publish to local maven repository -./gradlew build -x test publishToMavenLocal + +# Build +./gradlew build -x test + +# Publish to local maven repository +./gradlew publishToMavenLocal \ + -Psigning.secretKeyRingFile=... \ + -Psigning.password=... \ + -Psigning.keyId=... ``` ## Further development diff --git a/build.gradle.kts b/build.gradle.kts index 7a70354..03496db 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import java.net.URI + buildscript { repositories { mavenCentral() @@ -10,6 +12,7 @@ plugins { id("org.jlleitschuh.gradle.ktlint") version "12.0.3" id("org.jetbrains.kotlinx.kover") version "0.7.5" `maven-publish` + signing idea } @@ -28,6 +31,7 @@ subprojects { apply(plugin = "idea") apply(plugin = "java-library") apply(plugin = "maven-publish") + apply(plugin = "signing") apply(plugin = "org.jetbrains.kotlinx.kover") kotlin { @@ -72,6 +76,16 @@ subprojects { } publishing { + repositories { + maven { + url = URI.create("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = providers.gradleProperty("ossrhUsername").get() + password = providers.gradleProperty("ossrhPassword").get() + } + } + } + publications { create("mavenJava") { groupId = group.toString() @@ -105,6 +119,10 @@ subprojects { } } + signing { + sign(publishing.publications["mavenJava"]) + } + tasks.test { useJUnitPlatform { excludeTags(*System.getProperty("excludeTags", "no-tag").split(",").toTypedArray()) diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..d681957 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,6 @@ +signing.keyId=YourKeyId +signing.password=YourPublicKeyPassword +signing.secretKeyRingFile=PathToYourKeyRingFile + +ossrhUsername=your-jira-id +ossrhPassword=your-jira-password