Skip to content

Commit

Permalink
Attempt to fix publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Dec 23, 2023
1 parent 5c59b45 commit e6bc8c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
arguments: publish publishToSonatype closeSonatypeStagingRepository --stacktrace
env:
ACTIONS_REF: ${{ github.ref }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_PUBLISH_KEY }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PUBLISH_SECRET }}
ORG_GRADLE_PROJECT_mavenCentralKey: ${{ secrets.MAVEN_CENTRAL_PUBLISH_KEY }}
ORG_GRADLE_PROJECT_mavenCentralSecret: ${{ secrets.MAVEN_CENTRAL_PUBLISH_SECRET }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_PGP_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_PGP_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PGP_PASSWORD }}
15 changes: 12 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ configure<ModuleExtension> {

tasks.check.get().dependsOn(tasks.register<CheckActionsRefTask>("checkActions"))

// Add root project specifics to maven publication.
publishing.publications.getByName<MavenPublication>(Constants.PUBLICATION_NAME) {
pom {
packaging = "pom"
Expand All @@ -36,9 +37,17 @@ publishing.publications.getByName<MavenPublication>(Constants.PUBLICATION_NAME)

nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
val mavenCentralKey: String? by project
val mavenCentralSecret: String? by project

if (mavenCentralKey != null && mavenCentralSecret != null) {
sonatype {
username = mavenCentralKey
password = mavenCentralSecret

nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions build_logic/src/main/kotlin/yumi-commons-base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repositories {
mavenCentral()
}

// Setup publishing of artifacts.
publishing {
publications {
create<MavenPublication>(Constants.PUBLICATION_NAME) {
Expand Down Expand Up @@ -59,6 +60,7 @@ publishing {
}
}

// Setup signing.
signing {
val signingKeyId: String? by rootProject
val signingKey: String? by rootProject
Expand Down

0 comments on commit e6bc8c0

Please sign in to comment.