Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish to Maven Central

on:
push:
branches: [ "master" ]

jobs:
publish:
name: Build and publish to Maven Central
runs-on: macos-latest
timeout-minutes: 60

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Install GPG
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
brew install gpg
echo "$SIGNING_KEY" | gpg --dearmor > ${HOME}/secring.gpg

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Add Gradle Properties
env:
MAVEN_CENTRAL_USER_NAME: ${{ secrets.MAVEN_CENTRAL_USER_NAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: |
echo "mavenCentralUsername=${MAVEN_CENTRAL_USER_NAME}" >> gradle.properties
echo "mavenCentralPassword=${MAVEN_CENTRAL_PASSWORD}" >> gradle.properties
echo "signing.keyId=${SIGNING_KEY_ID}" >> gradle.properties
echo "signing.password=${SIGNING_KEY_PASSWORD}" >> gradle.properties
echo "signing.secretKeyRingFile=${HOME}/secring.gpg" >> gradle.properties

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Publish To Maven Central
run: |
./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.mokkery) apply false
alias(libs.plugins.maven.publish) apply false
}

subprojects {
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[versions]
input-engine = "2.0.1"
activityKtx = "1.10.1"
agp = "8.11.1"
androidx-activity = "1.10.1"
Expand All @@ -11,6 +12,7 @@ lifecycleViewmodelCompose = "2.9.1"
spotless = "7.1.0"
uiTestJunit4 = "1.8.3"
mokkery = "2.9.0"
maven-publish = "0.34.0"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
Expand All @@ -32,5 +34,6 @@ composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "k
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
mokkery = { id = "dev.mokkery", version.ref = "mokkery" }
59 changes: 59 additions & 0 deletions input-engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.composeCompiler)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.mokkery)
alias(libs.plugins.maven.publish)
}

kotlin {
Expand All @@ -21,6 +22,8 @@ kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)

publishLibraryVariants("release")

dependencies {
androidTestImplementation(libs.androidx.ui.test.junit4.android)
androidTestImplementation(libs.androidx.ui.test.manifest)
Expand Down Expand Up @@ -120,3 +123,59 @@ compose.resources {
packageOfResClass = "de.tillhub.inputengine.resources"
generateResClass = auto
}

mavenPublishing {
// Define coordinates for the published artifact
coordinates(
groupId = "io.github.tillhub",
artifactId = "input-engine",
version =
libs.versions.input.engine
.get(),
)

// Configure POM metadata for the published artifact
pom {
name.set("Input Engine")
description.set("Kotlin MultiPlatform Library which allows easy customisable UI inputs for money, quantity, percentage & PIN.")
inceptionYear.set("2025")
url.set("https://github.com/tillhub/input-engine")

licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}

// Specify developers information
developers {
developer {
id.set("djordjeh")
name.set("Đorđe Hrnjez")
email.set("dorde.hrnjez@unzer.com")
}
developer {
id.set("SloInfinity")
name.set("Martin Sirok")
email.set("m.sirok.ext@unzer.com")
}
developer {
id.set("shekar-allam")
name.set("Chandrashekar Allam")
email.set("chandrashekar.allam@unzer.com")
}
}

// Specify SCM information
scm {
url.set("https://github.com/tillhub/input-engine")
}
}

// Configure publishing to Maven Central
publishToMavenCentral()

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