Skip to content

Commit

Permalink
Merge pull request #7 from PAYONE-GmbH/feature/publishing_to_maven
Browse files Browse the repository at this point in the history
fix publishing to maven
  • Loading branch information
dnikolicnanogiants authored Sep 18, 2024
2 parents bd01922 + a7fcc9b commit 10fda77
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ jobs:
run: ./gradlew :pcp-client-android-sdk:build

- name: Publish to Maven Central
run: ./gradlew :pcp-client-android-sdk:publishAndReleaseToMavenCentral --no-configuration-cache
run: ./gradlew :pcp-client-android-sdk:publishAllPublicationsToCentralPortal
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}

SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

- name: Notify success
if: success()
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
id("com.vanniktech.maven.publish") version "0.28.0"
id("com.gradleup.nmcp") version "0.0.7"
}
23 changes: 22 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,25 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true

GROUP=io.github.payone-gmbh
POM_ARTIFACT_ID=pcp-client-android-sdk
VERSION_NAME=0.0.1

POM_NAME=PCP-CLIENT-SDK-ANDROID
POM_DESCRIPTION=The PAYONE Client Android SDK
POM_INCEPTION_YEAR=2024
POM_URL=https://github.com/PAYONE-GmbH/PCP-client-android-SDK

POM_LICENSE_NAME=MIT License
POM_LICENSE_URL=https://opensource.org/license/mit/
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/PAYONE-GmbH/PCP-client-android-SDK/
POM_SCM_CONNECTION=scm:git:git://github.com/PAYONE-GmbH/PCP-client-android-SDK.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/PAYONE-GmbH/PCP-client-android-SDK.git

POM_DEVELOPER_ID=PAYONE-GmbH
POM_DEVELOPER_NAME=PAYONE Intergrations
POM_DEVELOPER_URL=https://github.com/PAYONE-GmbH/
40 changes: 9 additions & 31 deletions pcp-client-android-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ plugins {
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.sonar)
kotlin("plugin.serialization") version "1.9.0"
id("com.vanniktech.maven.publish") version "0.29.0"
id("com.vanniktech.maven.publish") version "0.28.0"
id("com.gradleup.nmcp") version "0.0.7"
}

android {
Expand Down Expand Up @@ -53,36 +54,13 @@ dependencies {
debugImplementation("androidx.fragment:fragment-testing:1.5.7")
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
nmcp {
publishAllPublications {
val keyUsername = "SONATYPE_USERNAME"
val keyPassword = "SONATYPE_PASSWORD"
username = findProperty(keyUsername)?.toString() ?: System.getenv(keyUsername)
password = findProperty(keyPassword)?.toString() ?: System.getenv(keyPassword)

signAllPublications()

coordinates("io.github.payone-gmbh", "pcp-client-android-sdk", "0.0.1")

pom {
name.set("PCP-CLIENT-SDK-ANDROID")
description.set("The PAYONE Client Android SDK")
inceptionYear.set("2024")
url.set("https://github.com/PAYONE-GmbH/PCP-client-android-SDK")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/license/mit/")
}
}

developers {
developer {
name.set("Djordje Nikolic")
email.set("[email protected]")
}
}

scm {
url.set("https://github.com/PAYONE-GmbH/PCP-client-android-SDK")
connection.set("scm:git:git://github.com/PAYONE-GmbH/PCP-client-android-SDK.git")
developerConnection.set("scm:git:ssh://[email protected]/PAYONE-GmbH/PCP-client-android-SDK.git")
}
publicationType = "USER_MANAGED"
}
}

0 comments on commit 10fda77

Please sign in to comment.