Skip to content

Commit

Permalink
publish without special plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
stashymane committed Jun 18, 2024
1 parent 44a7e39 commit 471c9c2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: chmod +x gradlew

- name: Publish on Maven Central
run: ./gradlew publishToSonatype closeAndReleaseStagingRepository
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
12 changes: 0 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@ plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.nexusPublish)
}

allprojects {
group = "dev.stashy.midifunk"
version = "0.8.0-SNAPSHOT"


}

nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
19 changes: 19 additions & 0 deletions events/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ kotlin {
}
}

val releaseRepo: String by project.properties
val snapshotRepo: String by project.properties
val sonatypeUsername = project.findProperty("sonatypeUsername")?.toString()
val sonatypePassword = project.findProperty("sonatypePassword")?.toString()

publishing {
repositories {
maven {
name = "MavenCentral"
url = if (version.toString().endsWith("SNAPSHOT")) uri(snapshotRepo) else uri(releaseRepo)

credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}

signing {
isRequired = gradle.taskGraph.allTasks.any { it is PublishToMavenRepository }

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.configuration-cache=true
#Development
development=true
development=true
releaseRepo="https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
snapshotRepo="https://s01.oss.sonatype.org/content/repositories/snapshots/"
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dependencyResolutionManagement {
}
}

include(":events", ":devices", ":virtual-devices")
include(":events", ":devices")

0 comments on commit 471c9c2

Please sign in to comment.