Skip to content

Commit 94e9334

Browse files
committed
Use com.vanniktech.maven.publish for publishing
1 parent d0f5fa6 commit 94e9334

File tree

8 files changed

+64
-98
lines changed

8 files changed

+64
-98
lines changed

.github/workflows/release.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ jobs:
2626
run: sudo apt-get install libcurl4-openssl-dev
2727
- name: Maven Central Publish
2828
env:
29-
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
30-
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}
31-
ORG_GRADLE_PROJECT_signingKeyId: ${{secrets.ORG_GRADLE_PROJECT_signingKeyId}}
32-
ORG_GRADLE_PROJECT_signingKey: ${{secrets.ORG_GRADLE_PROJECT_signingKey}}
33-
ORG_GRADLE_PROJECT_signingPassword: ${{secrets.ORG_GRADLE_PROJECT_signingPassword}}
29+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{secrets.OSSRH_USERNAME}}
30+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{secrets.OSSRH_PASSWORD}}
31+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{secrets.ORG_GRADLE_PROJECT_signingKey}}
32+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{secrets.ORG_GRADLE_PROJECT_signingPassword}}
3433
IS_MAIN_PUBLISHER: ${{ startsWith(matrix.os,'ubuntu') }}
3534
TIX_VERSION: ${{github.ref_name}}
36-
run: ./gradlew publishAllPublicationsToSonatypeRepository
35+
run: ./gradlew publishAllPublicationsToMavenCentralRepository
3736
- name: Github Publish
3837
uses: ncipollo/release-action@v1
3938
with:

.github/workflows/snapshot.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ jobs:
2626
run: sudo apt-get install libcurl4-openssl-dev
2727
- name: Maven Central Publish
2828
env:
29-
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
30-
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}
31-
ORG_GRADLE_PROJECT_signingKeyId: ${{secrets.ORG_GRADLE_PROJECT_signingKeyId}}
32-
ORG_GRADLE_PROJECT_signingKey: ${{secrets.ORG_GRADLE_PROJECT_signingKey}}
33-
ORG_GRADLE_PROJECT_signingPassword: ${{secrets.ORG_GRADLE_PROJECT_signingPassword}}
29+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{secrets.OSSRH_USERNAME}}
30+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{secrets.OSSRH_PASSWORD}}
31+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{secrets.ORG_GRADLE_PROJECT_signingKey}}
32+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{secrets.ORG_GRADLE_PROJECT_signingPassword}}
3433
IS_MAIN_PUBLISHER: ${{ startsWith(matrix.os,'ubuntu') }}
35-
run: ./gradlew publishAllPublicationsToSonatypeRepository
34+
run: ./gradlew publishAllPublicationsToMavenCentralRepository

.idea/artifacts/core_js.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/core_jvm.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

+37-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@file:Suppress("UNUSED_VARIABLE")
22

33
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING
4+
import com.vanniktech.maven.publish.SonatypeHost
45

56
/**
67
* Dependency Hierarchy
@@ -24,8 +25,8 @@ plugins {
2425
val kotlinVersion = "1.8.21"
2526
kotlin("multiplatform") version kotlinVersion
2627
kotlin("plugin.serialization") version kotlinVersion
27-
id("publish.publication")
2828
id("com.codingfeline.buildkonfig") version "0.13.3"
29+
id("com.vanniktech.maven.publish") version "0.25.3"
2930
jacoco
3031
}
3132

@@ -278,4 +279,39 @@ tasks.register("jvmTestCoverage") {
278279
finalizedBy("jacocoTestReport")
279280
finalizedBy("jacocoTestCoverageVerification")
280281
finalizedBy("printCoverageLocation")
282+
}
283+
284+
// Publishing
285+
group = "io.github.ncipollo.tix"
286+
version = System.getenv("TIX_VERSION") ?: "1.0.0-SNAPSHOT"
287+
288+
mavenPublishing {
289+
publishToMavenCentral(SonatypeHost.S01)
290+
signAllPublications()
291+
292+
coordinates(group.toString(), name, version.toString())
293+
294+
// Provide artifacts information requited by Maven Central
295+
pom {
296+
name.set("Tix Core Library")
297+
description.set("Kotlin MPP library for authoring, tracking and managing tickets.")
298+
url.set("https://github.com/ncipollo/tix-core")
299+
300+
licenses {
301+
license {
302+
name.set("MIT")
303+
url.set("https://opensource.org/licenses/MIT")
304+
}
305+
}
306+
developers {
307+
developer {
308+
id.set("ncipollo")
309+
name.set("Nick Cipollo")
310+
email.set("[email protected]>")
311+
}
312+
}
313+
scm {
314+
url.set("https://github.com/ncipollo/tix-core.git")
315+
}
316+
}
281317
}

publish-plugin/build.gradle.kts

-7
This file was deleted.

publish-plugin/src/main/kotlin/publish.publication.gradle.kts

-76
This file was deleted.

settings.gradle.kts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
rootProject.name = "core"
2-
includeBuild("publish-plugin")
1+
rootProject.name = "core"

0 commit comments

Comments
 (0)