nalbion commited on
Commit
0422ae0
·
1 Parent(s): a3cb126

sign jar for Maven Central repo

Browse files
.github/workflows/build.yml CHANGED
@@ -437,6 +437,8 @@ jobs:
437
  MAVEN_PASSWORD: ${{ secrets.JIRA_PASS }}
438
  # MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
439
  # MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
 
 
440
 
441
  quantize:
442
  runs-on: ubuntu-latest
 
437
  MAVEN_PASSWORD: ${{ secrets.JIRA_PASS }}
438
  # MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
439
  # MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
440
+ PGP_SECRET: ${{ secrets.PGP_SECRET }}
441
+ PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
442
 
443
  quantize:
444
  runs-on: ubuntu-latest
bindings/java/build.gradle CHANGED
@@ -2,6 +2,7 @@ plugins {
2
  id 'java'
3
  id 'java-library'
4
  id 'maven-publish'
 
5
  }
6
 
7
  archivesBaseName = 'whispercpp'
@@ -112,7 +113,9 @@ publishing {
112
 
113
  repositories {
114
  maven {
115
- url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
 
 
116
  credentials {
117
  username = System.getenv("MAVEN_USERNAME")
118
  password = System.getenv("MAVEN_PASSWORD")
@@ -120,3 +123,10 @@ publishing {
120
  }
121
  }
122
  }
 
 
 
 
 
 
 
 
2
  id 'java'
3
  id 'java-library'
4
  id 'maven-publish'
5
+ id 'signing'
6
  }
7
 
8
  archivesBaseName = 'whispercpp'
 
113
 
114
  repositories {
115
  maven {
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
119
  credentials {
120
  username = System.getenv("MAVEN_USERNAME")
121
  password = System.getenv("MAVEN_PASSWORD")
 
123
  }
124
  }
125
  }
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
+ }