Skip to content

Commit

Permalink
Switch to vanniktech's maven publishing plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
t895 committed Sep 9, 2024
1 parent 0255209 commit 7d608b7
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 85 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
run: |
echo "${{ secrets.SIGNING_SECRET_KEYRING_BASE64 }}" | base64 --decode > keyring.asc
gpg --dearmor keyring.asc
- name: Set up environment
run: |
echo "mavenCentralUsername=${{secrets.MAVEN_USERNAME}}" >> gradle.properties
echo "mavenCentralPassword=${{secrets.MAVEN_PASSWORD}}" >> gradle.properties
echo "signing.keyId=${{secrets.SIGNING_KEY_ID}}" >> gradle.properties
echo "signing.password=${{secrets.SIGNING_PASSWORD}}" >> gradle.properties
echo "signing.secretKeyRingFile=${HOME}/keyring.asc.gpg" >> gradle.properties
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ plugins {
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.kotlinx.serialization).apply(false)
id("org.jetbrains.kotlinx.atomicfu") version "0.25.0" apply false
id("com.vanniktech.maven.publish") version "0.28.0" apply false
}
7 changes: 0 additions & 7 deletions convention-plugins/build.gradle.kts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ dependencyResolutionManagement {
mavenCentral()
}
}
includeBuild("convention-plugins")
include(":shared")
48 changes: 47 additions & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlinx.serialization)
id("org.jetbrains.kotlinx.atomicfu")
id("convention.publication")
id("com.vanniktech.maven.publish")
}

group = "com.t895.mcstatuskt"
Expand Down Expand Up @@ -74,3 +76,47 @@ android {
minSdk = 21
}
}

mavenPublishing {
// Define coordinates for the published artifact
coordinates(
groupId = "io.github.t895",
artifactId = "mcstatuskt",
version = "0.1.0"
)

// Configure POM metadata for the published artifact
pom {
name.set("mcstatuskt")
description.set("Simple Minecraft Server pinger")
inceptionYear.set("2024")
url.set("https://github.com/t895/mcstatuskt")

licenses {
license {
name.set("GPLv3")
url.set("https://opensource.org/licenses/gpl-3-0")
}
}

// Specify developer information
developers {
developer {
id.set("t895")
name.set("Charles Lombardo")
email.set("[email protected]")
}
}

// Specify SCM information
scm {
url.set("https://github.com/t895/mcstatuskt")
}
}

// Configure publishing to Maven Central
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

// Enable GPG signing for all publications
signAllPublications()
}

0 comments on commit 7d608b7

Please sign in to comment.