Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
feat(gradle): publish to sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Gaebel committed Mar 1, 2023
1 parent c67edc2 commit c7a7bc6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Publish package
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: publish
arguments: publishAllPublicationsToSonatypeRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
16 changes: 12 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
alias(libs.plugins.versioning)
alias(libs.plugins.kotlin.serialization)
id("maven-publish")
id("signing")
}

group = "com.liftric"
Expand Down Expand Up @@ -121,11 +122,11 @@ val javadocJar by tasks.registering(Jar::class) {
publishing {
repositories {
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/Liftric/kmm-job-queue")
name = "sonatype"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
username = ossrhUsername
password = ossrhPassword
}
}
}
Expand Down Expand Up @@ -163,3 +164,10 @@ afterEvaluate {
it.groupId = group.toString()
}
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}

0 comments on commit c7a7bc6

Please sign in to comment.