Closed sleipnir closed 4 years ago
The most interesting places:
before_deploy:
- echo $GPG_SECRET_KEYS | base64 --decode > $HOME/.gnupg/taymyr.gpg
deploy:
2. Plugins and their settings on root ([build.gradle.kts#L6-L7](https://github.com/taymyr/lagom-openapi/blob/0785237eb29bdd170d3df1c9e9d41ceaef24ee75/build.gradle.kts#L6-L7), [build.gradle.kts#L30-L35](https://github.com/taymyr/lagom-openapi/blob/0785237eb29bdd170d3df1c9e9d41ceaef24ee75/build.gradle.kts#L30-L35), [build.gradle.kts#L70-L76](https://github.com/taymyr/lagom-openapi/blob/0785237eb29bdd170d3df1c9e9d41ceaef24ee75/build.gradle.kts#L70-L76), [build.gradle.kts#L82-L87](https://github.com/taymyr/lagom-openapi/blob/0785237eb29bdd170d3df1c9e9d41ceaef24ee75/build.gradle.kts#L82-L87))
```kotlin
plugins {
...
id("io.codearte.nexus-staging") version Versions.`nexus-staging`
id("de.marcphilipp.nexus-publish") version Versions.`nexus-publish`
}
...
subprojects { nexusPublishing { repositories { sonatype() } clientTimeout.set(Duration.parse("PT10M")) // 10 minutes } } ... nexusStaging { packageGroup = "org.taymyr" username = ossrhUsername password = ossrhPassword numberOfRetries = 360 // 1 hour if 10 seconds delay delayBetweenRetriesInMillis = 10000 // 10 seconds }
tasks.closeRepository { mustRunAfter(subprojects.map { it.tasks.getByName("publishToSonatype") }.toTypedArray()) } tasks.closeAndReleaseRepository { mustRunAfter(subprojects.map { it.tasks.getByName("publishToSonatype") }.toTypedArray()) }
3. Settings of plugins in submodules ([/java/api/build.gradle.kts#L53-L69](https://github.com/taymyr/lagom-openapi/blob/0785237eb29bdd170d3df1c9e9d41ceaef24ee75/java/api/build.gradle.kts#L53-L69))
```kotlin
publishing {
publications {
create<MavenPublication>("maven") {
artifactId = "${project.name}_$scalaBinaryVersion"
from(components["java"])
artifact(sourcesJar)
artifact(dokkaJar)
pom(Publishing.pom)
}
}
}
@Suppress("UnstableApiUsage")
signing {
isRequired = isRelease
sign(publishing.publications["maven"])
}
Hi @ihostage thanks for the suggestions, I was really aware of the manual step but I didn't have time to look for another approach. Would you like to send a PR with the necessary changes? If you don't want to, I'll take a look at your repository and try to reproduce it. Thanks
Hi, @sleipnir! I suggest using special plugins. Otherwise, need manually release projects in Sonatype. As an example, you can look at one of my repository https://github.com/taymyr/lagom-openapi