Skip to content

Commit 3f1c6b9

Browse files
Apply publication requirements for Maven Central
1 parent 2ddade8 commit 3f1c6b9

3 files changed

Lines changed: 44 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ jobs:
4646
- name: Prepare Homebrew formula
4747
run: ./gradlew jreleaserPackage
4848

49-
- name: Update Homebrew formula in allegro/homebrew-tap
49+
- name: Update Homebrew formula in tap repo
5050
run: ./gradlew jreleaserPublish
5151
env:
5252
JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ steps.generate-homebrew-token.outputs.token }}
5353

54-
- name: Publish recipes to Maven Central
54+
- name: Publish to Maven Central
5555
run: ./gradlew publish closeSonatypeStagingRepository
5656
env:
5757
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
5858
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
59+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
60+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
61+
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}

allwrite-recipes/build.gradle.kts

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
`java-library`
33
`maven-publish`
44
`java-test-fixtures`
5+
signing
56
alias(libs.plugins.openrewrite.recipe.library.base)
67
id("conventions.kotlin")
78
id("conventions.koin")
@@ -50,22 +51,47 @@ dependencies {
5051
testImplementation(libs.rewrite.test)
5152
}
5253

53-
kotlin {
54-
compilerOptions {
55-
javaParameters = true
56-
}
57-
}
58-
5954
publishing {
6055
publications {
6156
create<MavenPublication>("library") {
6257
from(components["java"])
58+
pom {
59+
name = "allwrite-recipes"
60+
description = "A collection of recipes, filling the gaps in vanilla OpenRewrite"
61+
url = "https://github.com/allegro/allwrite"
62+
licenses {
63+
license {
64+
name = "Apache License, Version 2.0"
65+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
66+
}
67+
}
68+
scm {
69+
url = "https://github.com/allegro/allwrite"
70+
connection = "scm:git@github.com:allegro/allwrite.git"
71+
developerConnection = "scm:git@github.com:allegro/allwrite.git"
72+
}
73+
developers {
74+
developer {
75+
id = "radoslaw-panuszewski"
76+
name = "Radosław Panuszewski"
77+
}
78+
developer {
79+
id = "aleksandrserbin"
80+
name = "Aleksandr Serbin"
81+
}
82+
}
83+
}
6384
}
6485
}
6586
}
6687

67-
tasks {
68-
test {
69-
jvmArgs("-Xmx4g")
88+
signing {
89+
val gpgKeyId = System.getenv("GPG_KEY_ID")
90+
val gpgPrivateKey = System.getenv("GPG_PRIVATE_KEY")
91+
val gpgPrivateKeyPassword = System.getenv("GPG_PRIVATE_KEY_PASSWORD")
92+
93+
if (gpgKeyId != null && gpgPrivateKey != null && gpgPrivateKeyPassword != null) {
94+
useInMemoryPgpKeys(gpgKeyId, gpgPrivateKey, gpgPrivateKeyPassword)
95+
sign(publishing.publications["library"])
7096
}
7197
}

build-logic/kotlin-compilation/src/main/kotlin/conventions/kotlin.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ plugins {
1313

1414
java {
1515
withSourcesJar()
16+
withJavadocJar()
1617
}
1718

1819
kotlin {
1920
jvmToolchain(libs.versions.jvm.get().toInt())
2021
explicitApi()
22+
compilerOptions {
23+
javaParameters = true
24+
}
2125
}
2226

2327
tasks {

0 commit comments

Comments
 (0)