diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 877120e..ea1314a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/build.gradle.kts b/build.gradle.kts index 569c2bb..7ad9a25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,7 @@ plugins { alias(libs.plugins.versioning) alias(libs.plugins.kotlin.serialization) id("maven-publish") + id("signing") } group = "com.liftric" @@ -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 } } } @@ -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) +}