From 583034d0b7cd2e272ec30df3e063603143e4e675 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Wed, 20 Aug 2025 00:46:06 +0530 Subject: [PATCH 1/3] build: move to maven central --- .github/workflows/publish.yml | 10 +-- .github/workflows/test-publish.yml | 2 +- build.gradle | 18 ----- lexfloatclient/build.gradle | 105 +++++++++++----------------- lexfloatclient/maven-central.gradle | 86 ----------------------- 5 files changed, 46 insertions(+), 175 deletions(-) delete mode 100644 lexfloatclient/maven-central.gradle diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5e971de..d062645 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,8 +55,8 @@ jobs: - name: Publish with Gradle env: - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }} - OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - run: ./gradlew lexfloatclient:publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository -PlexVersion=${{github.event.inputs.packageVersion}} --info --warning-mode all + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY_ARMORED }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }} + run: ./gradlew lexfloatclient:publishAndReleaseToMavenCentral -PlexVersion=${{github.event.inputs.packageVersion}} --info --warning-mode all diff --git a/.github/workflows/test-publish.yml b/.github/workflows/test-publish.yml index bbd698c..e49113f 100644 --- a/.github/workflows/test-publish.yml +++ b/.github/workflows/test-publish.yml @@ -25,4 +25,4 @@ jobs: run: gradle wrapper - name: Publish with Gradle - run: ./gradlew lexfloatclient:publishTestPublicationToMavenLocal --info --warning-mode all \ No newline at end of file + run: ./gradlew lexfloatclient:publishToMavenLocal --info --warning-mode all --dry-run \ No newline at end of file diff --git a/build.gradle b/build.gradle index 89ca042..070bdf7 100644 --- a/build.gradle +++ b/build.gradle @@ -8,10 +8,6 @@ buildscript { } } -plugins { - id "io.github.gradle-nexus.publish-plugin" version "1.3.0" -} - if (project.hasProperty("lexVersion")) { project.setVersion(lexVersion) } @@ -19,20 +15,6 @@ ext { PUBLISH_GROUP_ID = 'com.cryptlex.android.lexfloatclient' PUBLISH_ARTIFACT_ID = 'lexfloatclient' PUBLISH_VERSION = version - OSSRH_USERNAME = System.getenv('OSSRH_USERNAME') - OSSRH_PASSWORD = System.getenv('OSSRH_PASSWORD') -} - -nexusPublishing { - repositories { - sonatype { - stagingProfileId = "24cd3440581936" - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - username = OSSRH_USERNAME - password = OSSRH_PASSWORD - } - } } group = "com.cryptlex.android.lexfloatclient" diff --git a/lexfloatclient/build.gradle b/lexfloatclient/build.gradle index e3d317d..3895435 100644 --- a/lexfloatclient/build.gradle +++ b/lexfloatclient/build.gradle @@ -1,7 +1,6 @@ plugins { id 'com.android.library' - id 'maven-publish' - id 'signing' + id 'com.vanniktech.maven.publish' version '0.34.0' } android { @@ -23,74 +22,50 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - publishing { - singleVariant("release") { - withSourcesJar() - withJavadocJar() - } - } - namespace 'com.cryptlex.android.lexfloatclient' } +repositories { + mavenCentral() +} + dependencies { implementation 'net.java.dev.jna:jna:5.13.0@aar' implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2' } -publishing { - publications { - release(MavenPublication) { - groupId PUBLISH_GROUP_ID - artifactId PUBLISH_ARTIFACT_ID - version PUBLISH_VERSION - afterEvaluate { - from components.release - pom { - name = 'LexFloatClient' - description = 'LexFloatClient wrapper for Android (licensing library).' - url = 'https://github.com/cryptlex/lexfloatclient-android' - licenses { - license { - name = 'MIT License' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - organization { - name = 'Cryptlex, LLC' - url = 'https://cryptlex.com' - } - developers { - developer { - name = 'Cryptlex Team' - email = 'support@cryptlex.com' - organization = 'Cryptlex, LLC.' - organizationUrl = 'https://cryptlex.com' - } - } - scm { - connection = 'scm:git:https://github.com/cryptlex/lexfloatclient-android.git' - developerConnection = 'scm:git:ssh://github.com/cryptlex/lexfloatclient-android.git' - url = 'https://github.com/cryptlex/lexfloatclient-android' - } - } - } - } - - test(MavenPublication) { - groupId PUBLISH_GROUP_ID - artifactId PUBLISH_ARTIFACT_ID - version PUBLISH_VERSION - afterEvaluate { - from components.release - } - } - } -} - -signing { - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") - useInMemoryPgpKeys(signingKey, signingPassword) - sign publishing.publications.release -} +mavenPublishing { + publishToMavenCentral(true) + signAllPublications() + + coordinates(PUBLISH_GROUP_ID, PUBLISH_ARTIFACT_ID, PUBLISH_VERSION) + + pom { + name = 'LexFloatClient' + description = 'LexFloatClient wrapper for Android (licensing library).' + url = 'https://github.com/cryptlex/lexfloatclient-android' + licenses { + license { + name = 'MIT License' + url = 'http://www.opensource.org/licenses/mit-license.php' + } + } + organization { + name = 'Cryptlex, LLC' + url = 'https://cryptlex.com' + } + developers { + developer { + name = 'Cryptlex Team' + email = 'support@cryptlex.com' + organization = 'Cryptlex, LLC.' + organizationUrl = 'https://cryptlex.com' + } + } + scm { + connection = 'scm:git:https://github.com/cryptlex/lexfloatclient-android.git' + developerConnection = 'scm:git:ssh://github.com/cryptlex/lexfloatclient-android.git' + url = 'https://github.com/cryptlex/lexfloatclient-android' + } + } +} \ No newline at end of file diff --git a/lexfloatclient/maven-central.gradle b/lexfloatclient/maven-central.gradle deleted file mode 100644 index efa0a69..0000000 --- a/lexfloatclient/maven-central.gradle +++ /dev/null @@ -1,86 +0,0 @@ -apply plugin: 'maven-publish' -apply plugin: 'signing' - -task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - android.libraryVariants.all { variant -> - if (variant.name == 'release') { - owner.classpath += variant.javaCompileProvider.get().classpath - } - } - exclude '**/R.html', '**/R.*.html', '**/index.html' -} - -task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - archiveClassifier.set('javadoc') - from androidJavadocs.destinationDir -} - -task androidSourcesJar(type: Jar) { - archiveClassifier.set('sources') - from android.sourceSets.main.java.srcDirs -} - -afterEvaluate{project -> - publishing { - publications { - release( MavenPublication ) { - - groupId PUBLISH_GROUP_ID - artifactId PUBLISH_ARTIFACT_ID - version PUBLISH_VERSION - - artifact bundleReleaseAar - artifact androidJavadocsJar - artifact androidSourcesJar - - pom { - name = 'LexFloatClient' - description = 'LexFloatClient wrapper for Android (licensing library).' - url = 'https://github.com/cryptlex/lexfloatclient-android' - licenses { - license { - name = 'MIT License' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - organization { - name = 'Cryptlex, LLC' - url = 'https://cryptlex.com' - } - developers { - developer { - name = 'Cryptlex Team' - email = 'support@cryptlex.com' - organization = 'Cryptlex, LLC.' - organizationUrl = 'https://cryptlex.com' - } - } - scm { - connection = 'scm:git:https://github.com/cryptlex/lexfloatclient-android.git' - developerConnection = 'scm:git:ssh://github.com/cryptlex/lexfloatclient-android.git' - url = 'https://github.com/cryptlex/lexfloatclient-android' - } - withXml { - def dependenciesNode = asNode().appendNode('dependencies') - - project.configurations.implementation.allDependencies.each { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', it.group) - dependencyNode.appendNode('artifactId', it.name) - dependencyNode.appendNode('version', it.version) - } - } - } - } - } - } -} - -signing { - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") - useInMemoryPgpKeys(signingKey, signingPassword) - sign publishing.publications -} From d1c8f5d0f33c8b2494bbe052e1a803b7be6eccc7 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Fri, 22 Aug 2025 10:36:21 +0530 Subject: [PATCH 2/3] chore: LLC -> LLP --- lexfloatclient/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lexfloatclient/build.gradle b/lexfloatclient/build.gradle index 3895435..e00aa8e 100644 --- a/lexfloatclient/build.gradle +++ b/lexfloatclient/build.gradle @@ -51,14 +51,14 @@ mavenPublishing { } } organization { - name = 'Cryptlex, LLC' + name = 'Cryptlex, LLP' url = 'https://cryptlex.com' } developers { developer { name = 'Cryptlex Team' email = 'support@cryptlex.com' - organization = 'Cryptlex, LLC.' + organization = 'Cryptlex, LLP.' organizationUrl = 'https://cryptlex.com' } } From 6a00f682c06ac468d686689a6f3c2ac264613971 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Fri, 22 Aug 2025 17:20:10 +0530 Subject: [PATCH 3/3] ci: setup gradle version --- .github/workflows/publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d062645..fca8c40 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,10 +48,14 @@ jobs: with: distribution: 'temurin' java-version: '17' - cache: 'gradle' + + - name: Setup Gradle 8.14 + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '8.14' - name: Gradle Wrapper - run: gradle wrapper + run: gradle wrapper --gradle-version=8.14 - name: Publish with Gradle env: