From b67a4a22b5038645026399d554a3e8a18cffa741 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Wed, 22 Jul 2026 23:07:38 +0600 Subject: [PATCH] feat(plugin_interfaces): update Maven publishing configuration and add GitHub Actions workflow --- .github/workflows/maven-publish.yml | 26 +++++++++++++++++++ gradle/libs.versions.toml | 4 ++- plugin_interfaces/build.gradle.kts | 39 +++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 00000000..46deed55 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,26 @@ +# .github/workflows/publish.yml + +name: Maven Publish +on: + workflow_dispatch: + +jobs: + publish: + name: Release build and publish + runs-on: macOS-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 21 + - name: Publish to MavenCentral + run: ./gradlew publishToMavenCentral --no-configuration-cache + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MAVEN_SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_SIGNING_KEY_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_GPG_KEY_CONTENTS }} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1ab1fd02..ac16f35c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -72,6 +72,7 @@ spotube-gradle = "0.1.0" cryptography = "0.6.0" reorderable = "3.1.0" vlcjBundler = "0.1.0" +vanniktechMavenPublish = "0.37.0" uniffi = "0.3.7" kotlinx-atomicfu = "0.33.0" mokkery = "3.3.0" @@ -181,4 +182,5 @@ vlcjBundler = { id = "dev.krtirtho.vlcj-bundler.gradle-plugin", version.ref = "v kotlinxAtomicFu = { id = "org.jetbrains.kotlinx.atomicfu", version.ref = "kotlinx-atomicfu" } uniffi = { id = "dev.gobley.uniffi", version.ref = "uniffi" } cargo = { id = "dev.gobley.cargo", version.ref = "uniffi" } -mokkery = { id = "dev.mokkery", version.ref = "mokkery" } \ No newline at end of file +mokkery = { id = "dev.mokkery", version.ref = "mokkery" } +vanniktechMavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechMavenPublish" } \ No newline at end of file diff --git a/plugin_interfaces/build.gradle.kts b/plugin_interfaces/build.gradle.kts index 55331727..b079c3eb 100644 --- a/plugin_interfaces/build.gradle.kts +++ b/plugin_interfaces/build.gradle.kts @@ -16,7 +16,7 @@ */ plugins { - alias(libs.plugins.mavenPublish) + alias(libs.plugins.vanniktechMavenPublish) alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidKotlinMultiplatformLibrary) alias(libs.plugins.kotlinSerialization) @@ -32,7 +32,7 @@ kotlin { // which platforms this KMP module supports. // See: https://kotlinlang.org/docs/multiplatform-discover-project.html#targets androidLibrary { - namespace = "dev.krtirtho.plugin_interfaces" + namespace = "dev.krtirtho.spotube.plugin_interfaces" compileSdk = libs.versions.android.compileSdk.get().toInt() minSdk = libs.versions.android.minSdk.get().toInt() @@ -91,4 +91,39 @@ kotlin { jsMain.dependencies {} } +} + +mavenPublishing { + publishToMavenCentral() + signAllPublications() + coordinates( + group.toString(), + "plugin_interfaces", + version.toString() + ) + pom { + name = "plugin_interfaces" + description = "Plugin interfaces for Spotube" + inceptionYear = "2026" + url = "https://github.com/KRTirtho/spotube" + licenses { + license { + name = "AGPL-3.0-or-later" + url = "https://spdx.org/licenses/AGPL-3.0-or-later.html" + distribution = "https://spdx.org/licenses/AGPL-3.0-or-later.html" + } + } + developers { + developer { + id = "KRTirtho" + name = "Kingkor Roy Tirtho" + url = "https://github.com/KRTirtho/" + } + } + scm { + url = "https://github.com/KRTirtho/spotube" + connection = "scm:git:git://github.com/KRTirtho/spotube.git" + developerConnection = "scm:git:ssh://git@github.com/KRTirtho/spotube.git" + } + } } \ No newline at end of file