Skip to content

Commit 6719211

Browse files
committed
Updated publishing
1 parent 51e0e9f commit 6719211

File tree

2 files changed

+38
-47
lines changed

2 files changed

+38
-47
lines changed

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131

3232
- name: Publish To Maven Central
3333
env:
34-
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
35-
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
34+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
35+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3636
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
3737
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
3838
run: |

soundfont/build.gradle.kts

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import com.vanniktech.maven.publish.SonatypeHost
2-
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3-
import org.jetbrains.kotlin.konan.target.KonanTarget
4-
import org.jetbrains.kotlin.konan.util.DependencyDirectories.localKonanDir
2+
53
// import pl.lemanski.plugin.KonanPluginExtension
64

75
plugins {
86
alias(libs.plugins.kotlinMultiplatform)
97
alias(libs.plugins.androidLibrary)
108
alias(libs.plugins.maven.publish)
119
// id("pl.lemanski.plugin")
12-
`maven-publish`
1310
signing
1411
}
1512

@@ -93,63 +90,57 @@ kotlin {
9390
// }?.absolutePath
9491
//}
9592

96-
//
93+
// Publishing
9794

98-
publishing {
99-
repositories {
100-
maven {
101-
name = "MavenCentral"
95+
mavenPublishing {
96+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
10297

103-
setUrl {
104-
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
105-
}
98+
coordinates(
99+
groupId = group.toString(),
100+
artifactId = "soundfont",
101+
version = version.toString()
102+
)
106103

107-
credentials {
108-
username = System.getenv("MAVEN_CENTRAL_USERNAME")
109-
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
110-
}
104+
println(SonatypeHost.DEFAULT.toString())
105+
106+
pom {
107+
name.set("MikroSoundFont")
108+
description.set("Kotlin Multiplatform library for sample-based synthesis to play MIDI files.")
109+
inceptionYear.set("2024")
110+
url.set("https://github.com/lemcoder/MikroSoundFont")
111111

112-
authentication {
113-
create<BasicAuthentication>("basic")
112+
licenses {
113+
license {
114+
name.set("Apache-2.0 license")
115+
url.set("https://www.apache.org/licenses/LICENSE-2.0")
114116
}
115117
}
116-
}
117118

118-
publications {
119-
withType<MavenPublication> {
120-
pom {
121-
name.set("MikroSoundFont")
122-
description.set("Kotlin Multiplatform library for sample-based synthesis to play MIDI files.")
123-
inceptionYear.set("2024")
124-
url.set("https://github.com/lemcoder/MikroSoundFont")
125-
126-
licenses {
127-
license {
128-
name.set("Apache-2.0 license")
129-
url.set("https://www.apache.org/licenses/LICENSE-2.0")
130-
}
131-
}
132-
133-
developers {
134-
developer {
135-
id.set("lemcoder")
136-
name.set("Mikołaj Lemański")
137-
email.set("[email protected]")
138-
}
139-
}
140-
141-
scm {
142-
url.set("https://github.com/lemcoder/MikroSoundFont")
143-
}
119+
developers {
120+
developer {
121+
id.set("lemcoder")
122+
name.set("Mikołaj Lemański")
123+
email.set("[email protected]")
144124
}
145125
}
126+
127+
scm {
128+
url.set("https://github.com/lemcoder/MikroSoundFont")
129+
}
146130
}
147131
}
148132

133+
// Sign with default plugin
149134
signing {
150135
useInMemoryPgpKeys(
151136
System.getenv("SIGNING_KEY"),
152137
System.getenv("SIGNING_KEY_PASSWORD")
153138
)
154139
sign(publishing.publications)
140+
141+
// Temporary workaround, see https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958
142+
tasks.withType<AbstractPublishToMaven>().configureEach {
143+
val signingTasks = tasks.withType<Sign>()
144+
mustRunAfter(signingTasks)
145+
}
155146
}

0 commit comments

Comments
 (0)