File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,19 +40,18 @@ jobs:
4040
4141 # Publish
4242 - name : Publish packages (GitHub)
43- if : github.event_name == 'push' && !startsWith(github.ref_name, 'renovate/')
43+ if : github.event_name == 'push' && github.ref_type != 'tag' && !startsWith(github.ref_name, 'renovate/')
4444 run : gradle publishAllPublicationsToGitHubRepository
4545 env :
4646 GITHUB_ACTOR : ${{github.actor}}
4747 GITHUB_TOKEN : ${{github.token}}
48- # - name: Publish packages (Maven Central)
49- # if: github.ref_type == 'tag'
50- # run: gradle publishToSonatype closeAndReleaseSonatypeStagingRepository
51- # env:
52- # SIGNING_KEY: ${{secrets.SIGNING_KEY}}
53- # SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}}
54- # SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}}
55- # SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}}
48+ - name : Publish packages (Maven Central)
49+ if : github.ref_type == 'tag'
50+ run : gradle publishToSonatype closeAndReleaseSonatypeStagingRepository
51+ env :
52+ GPG_KEY : ${{secrets.GPG_KEY}}
53+ ORG_GRADLE_PROJECT_sonatypeUsername : ${{secrets.SONATYPE_USERNAME}}
54+ ORG_GRADLE_PROJECT_sonatypePassword : ${{secrets.SONATYPE_PASSWORD}}
5655 - name : Publish documentation
5756 if : github.ref_type == 'tag'
5857 uses : peaceiris/actions-gh-pages@v3
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ plugins {
88 id(" org.jetbrains.dokka" ) version " 2.1.0"
99 id(" org.jetbrains.dokka-javadoc" ) version " 2.1.0"
1010 id(" maven-publish" )
11+ id(" signing" )
12+ id(" io.github.gradle-nexus.publish-plugin" ) version " 2.0.0"
1113}
1214
1315subprojects {
@@ -22,6 +24,7 @@ subprojects {
2224 apply (plugin = " org.jetbrains.dokka" )
2325 apply (plugin = " org.jetbrains.dokka-javadoc" )
2426 apply (plugin = " maven-publish" )
27+ apply (plugin = " signing" )
2528
2629 kotlin {
2730 compilerOptions.allWarningsAsErrors = true
@@ -86,6 +89,14 @@ subprojects {
8689 }
8790 }
8891
92+ configure<SigningExtension > {
93+ val gpgKey = System .getenv(" GPG_KEY" )
94+ if (gpgKey != null ) {
95+ useInMemoryPgpKeys(gpgKey, " " )
96+ sign(the<PublishingExtension >().publications[" maven" ])
97+ }
98+ }
99+
89100 repositories {
90101 maven {
91102 name = " GitHub"
@@ -102,3 +113,12 @@ subprojects {
102113dependencies {
103114 subprojects.forEach { dokka(it) }
104115}
116+
117+ nexusPublishing {
118+ repositories {
119+ sonatype {
120+ nexusUrl.set(uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" ))
121+ snapshotRepositoryUrl.set(uri(" https://central.sonatype.com/repository/maven-snapshots/" ))
122+ }
123+ }
124+ }
You can’t perform that action at this time.
0 commit comments