Skip to content

Commit 11b2d6e

Browse files
committed
sign jar for Maven Central repo
1 parent 11737ae commit 11b2d6e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ jobs:
437437
MAVEN_PASSWORD: ${{ secrets.JIRA_PASS }}
438438
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
439439
# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
440+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
441+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
440442

441443
quantize:
442444
runs-on: ubuntu-latest

bindings/java/build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id 'java'
33
id 'java-library'
44
id 'maven-publish'
5+
id 'signing'
56
}
67

78
archivesBaseName = 'whispercpp'
@@ -112,11 +113,20 @@ publishing {
112113

113114
repositories {
114115
maven {
115-
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
116+
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
117+
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
118+
url = version.endsWith('-SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
116119
credentials {
117120
username = System.getenv("MAVEN_USERNAME")
118121
password = System.getenv("MAVEN_PASSWORD")
119122
}
120123
}
121124
}
122125
}
126+
127+
signing {
128+
def signingKey = System.getenv("PGP_SECRET")
129+
def signingPassword = System.getenv("PGP_PASSPHRASE")
130+
useInMemoryPgpKeys(signingKey, signingPassword)
131+
sign publishing.publications.mavenJava
132+
}

0 commit comments

Comments
 (0)