Skip to content

Commit

Permalink
feat(publish): Fixed maven publishing to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
Burtan committed May 15, 2024
1 parent d7813c8 commit c772082
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Publish
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
export ORG_GRADLE_PROJECT_VERSION_NAME=${NEW_VERSION}
./gradlew publish --stacktrace
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
run: ./gradlew publish
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
4 changes: 1 addition & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ tasks.named<Test>("jvmTest") {
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()

coordinates("de.frederikbertling.kosc", "core", "0.1.0")

pom {
name.set("kOSC core library")
description.set("OSC implementation for kotlin multiplatform")
Expand Down
4 changes: 1 addition & 3 deletions udp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,10 @@ tasks.named<Test>("jvmTest") {
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)

signAllPublications()

coordinates("de.frederikbertling.kosc", "udp", "0.1.0")

pom {
name.set("kOSC UDP server and client implementation")
description.set("OSC over UDP implementation for kotlin multiplatform")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OSCUDPSocketTest : StringSpec() {

init {
"OSCUDPSocket test #1" {
val port = Random.nextInt(8080..30000)
val port = Random.nextInt(8080..8090)
val listener = OSCUDPSocket(port)
val client = OSCUDPSocket("localhost", port)
testClient(client, listener)
Expand All @@ -29,7 +29,7 @@ class OSCUDPSocketTest : StringSpec() {
}

"OSCUDPSocket test #2" {
val port = Random.nextInt(8080..30000)
val port = Random.nextInt(8080..8090)
val listener = OSCUDPSocket(port)
val client = OSCUDPSocket(InetSocketAddress("localhost", port))
testClient(client, listener)
Expand All @@ -38,14 +38,14 @@ class OSCUDPSocketTest : StringSpec() {
}

"OSCUDPSocket test #3" {
val port = Random.nextInt(8080..30000)
val port = Random.nextInt(8080..8090)
val listenerClient = OSCUDPSocket("localhost", port, port)
testClient(listenerClient, listenerClient)
listenerClient.close()
}

"OSCUDPSocket test #4" {
val port = Random.nextInt(8080..30000)
val port = Random.nextInt(8080..8090)
val listenerClient = OSCUDPSocket(
localAddress = InetSocketAddress("localhost", port),
remoteAddress = InetSocketAddress("localhost", port)
Expand Down

0 comments on commit c772082

Please sign in to comment.