Skip to content

Commit

Permalink
Merge pull request #21 from mayorJAY/feat-maven-publish
Browse files Browse the repository at this point in the history
Automate Artifacts release
  • Loading branch information
unicodeveloper authored Sep 19, 2023
2 parents 443ed86 + c6b795f commit 7f04494
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}

- name: Release artifacts
run: ./gradlew closeAndReleaseRepository
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
18 changes: 13 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ plugins {
`maven-publish`
signing
id("org.jlleitschuh.gradle.ktlint") version "11.3.1"

id("io.codearte.nexus-staging") version "0.30.0"
id("java-library")
kotlin("jvm") version "1.8.0"
}

group = "co.novu"
version = "1.0.0"

Expand Down Expand Up @@ -42,16 +43,15 @@ dependencies {
implementation("org.slf4j:slf4j-api:1.7.36")
implementation("org.slf4j:slf4j-simple:1.7.36")
}

tasks.test {
useJUnitPlatform()
}

kotlin {
jvmToolchain(8)
}
// extensions.findByName("buildScan")?.withGroovyBuilder {
// setProperty("termsOfServiceUrl", "https://gradle.com/terms-of-service")
// setProperty("termsOfServiceAgree", "yes")
// }

publishing {
repositories {
maven {
Expand Down Expand Up @@ -114,14 +114,22 @@ publishing {
}
}
}

signing {
val signingKey = System.getenv("MAVEN_GPG_PRIVATE_KEY")
val signingPassword = System.getenv("MAVEN_GPG_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}

tasks.javadoc {
if (JavaVersion.current().isJava8Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}

nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}

0 comments on commit 7f04494

Please sign in to comment.