Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- name: Build all modules with Gradle
run: ./gradlew build
- name: Publish
run: ./gradlew -Pversion=$version publish
run: ./gradlew -Pversion=$version -Dorg.gradle.parallel=false publish closeAndReleaseStagingRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONARTYPE_APIKEY: ${{ secrets.SONARTYPE_APIKEY }}
SONARTYPE_APITOKEN: ${{ secrets.SONARTYPE_APITOKEN }}
67 changes: 66 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
plugins {
kotlin("multiplatform") version "1.5.21" apply false
kotlin("plugin.serialization") version "1.5.21" apply false
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

group = "app.softwork"
Expand All @@ -9,10 +12,72 @@ repositories {
mavenCentral()
}

subprojects {
nexusPublishing {
repositories {
sonatype {
username.set(System.getProperty("sonartype.apiKey") ?: System.getenv("SONARTYPE_APIKEY"))
password.set(System.getProperty("sonartype.apiToken") ?: System.getenv("SONARTYPE_APITOKEN"))
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}

allprojects {
apply(plugin = "org.gradle.maven-publish")
apply(plugin = "org.gradle.signing")

group = "app.softwork"

repositories {
mavenCentral()
}

group = "app.softwork"

task("emptyJar", Jar::class) {
}

publishing {
publications.all {
if (this is MavenPublication) {
artifact(tasks.getByName("emptyJar")) {
classifier = "javadoc"
}
pom {
name.set("app.softwork CloudKit Client Library")
description.set("A multiplatform Kotlin library to use Apple CloudKit")
url.set("https://github.com/hfhbd/CloudKitClient")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("hfhbd")
name.set("Philip Wedemann")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git://github.com/hfhbd/CloudKitClient.git")
developerConnection.set("scm:git://github.com/hfhbd/CloudKitClient.git")
url.set("https://github.com/hfhbd/CloudKitClient")
}
}
}
}
}
(System.getProperty("signing.privateKey") ?: System.getenv("SIGNING_PRIVATE_KEY"))?.let {
String(java.util.Base64.getDecoder().decode(it)).trim()
}?.let { key ->
println("found key, config signing")
signing {
val signingPassword = System.getProperty("signing.password") ?: System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(key, signingPassword)
sign(publishing.publications)
}
}
}
14 changes: 0 additions & 14 deletions cloudkitclient-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
kotlin("plugin.serialization")
id("org.jetbrains.dokka") version "1.5.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.6.0"
`maven-publish`
}

kotlin {
Expand Down Expand Up @@ -33,16 +32,3 @@ kotlin {
}
}
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/hfhbd/cloudkitclient")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
14 changes: 0 additions & 14 deletions cloudkitclient-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
kotlin("plugin.serialization")
id("org.jetbrains.dokka") version "1.5.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.6.0"
`maven-publish`
}

kotlin {
Expand All @@ -25,16 +24,3 @@ kotlin {
}
}
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/hfhbd/cloudkitclient")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}