From f12fe798bd931d86a20382bddbaeaf3ea26b6261 Mon Sep 17 00:00:00 2001 From: Laimonas Turauskas Date: Fri, 23 Jan 2026 11:39:00 -0500 Subject: [PATCH 1/2] Version 0.4.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d58a130..434b076 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.laimiux.lce -VERSION_NAME=0.4.0 +VERSION_NAME=0.4.1 POM_DESCRIPTION=LCE From cc4dc3a7942df93edfdab8dac6466eeedc50b869 Mon Sep 17 00:00:00 2001 From: Laimonas Turauskas Date: Fri, 23 Jan 2026 15:19:05 -0500 Subject: [PATCH 2/2] Fixing maven uploads. --- .buildscript/configure-signing.gradle | 35 ++++++------------- .buildscript/upload_archives.sh | 4 ++- .gitignore | 5 ++- SIGNING.md | 48 +++++++++++++++++++++++++++ gradle/libs.versions.toml | 2 +- 5 files changed, 67 insertions(+), 27 deletions(-) create mode 100644 SIGNING.md diff --git a/.buildscript/configure-signing.gradle b/.buildscript/configure-signing.gradle index 7ab933c..11cd566 100644 --- a/.buildscript/configure-signing.gradle +++ b/.buildscript/configure-signing.gradle @@ -1,34 +1,21 @@ -apply plugin: "signing" apply plugin: "com.vanniktech.maven.publish" if (project.hasProperty('releaseBuild')) { println "configuring signing key" - Properties properties = new Properties() - if (project.rootProject.file('local.properties').exists()) { - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - } - - signing { - def signingKeyFilename = properties.signingKey - - def signingKey = "${project.rootProject.file(signingKeyFilename).newDataInputStream()}" - def signingPassword = properties.signingPassword - - useInMemoryPgpKeys(signingKey, signingPassword) - } + // Environment variables are expected to be set via export_signing.sh: + // - ORG_GRADLE_PROJECT_mavenCentralUsername + // - ORG_GRADLE_PROJECT_mavenCentralPassword + // - ORG_GRADLE_PROJECT_signingInMemoryKey + // - ORG_GRADLE_PROJECT_signingInMemoryKeyId + // - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword - mavenPublish { - targets { - // Modify the existing uploadArchives task - uploadArchives { - repositoryUsername = properties.SONATYPE_NEXUS_USERNAME - repositoryPassword = properties.SONATYPE_NEXUS_PASSWORD - } - } + mavenPublishing { + publishToMavenCentral("CENTRAL_PORTAL") + signAllPublications() } } else { - mavenPublish { - releaseSigningEnabled = false + mavenPublishing { + publishToMavenCentral("CENTRAL_PORTAL") } } diff --git a/.buildscript/upload_archives.sh b/.buildscript/upload_archives.sh index 27fe530..dd96548 100755 --- a/.buildscript/upload_archives.sh +++ b/.buildscript/upload_archives.sh @@ -1,3 +1,5 @@ +source export_signing.sh + ./gradlew clean ./gradlew :lce:build -PreleaseBuild ./gradlew :lce-rxjava3:build -PreleaseBuild @@ -6,4 +8,4 @@ # Disabling parallelism and daemon sharing is required by the vanniktech maven publish plugin. # Without those, the artifacts will be split across multiple (invalid) staging repositories. -./gradlew uploadArchives -PreleaseBuild --no-parallel --no-daemon +./gradlew publishToMavenCentral -PreleaseBuild --no-parallel --no-daemon diff --git a/.gitignore b/.gitignore index a85ca04..7ef6889 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,7 @@ .java-version # Claude -.claude/settings.local.json \ No newline at end of file +.claude/settings.local.json + +# Signing +export_signing.sh \ No newline at end of file diff --git a/SIGNING.md b/SIGNING.md new file mode 100644 index 0000000..109046c --- /dev/null +++ b/SIGNING.md @@ -0,0 +1,48 @@ +# Signing Configuration + +## Setup + +1. **Export your GPG secret key:** + ```bash + gpg --export-secret-keys --armor YOUR_KEY_ID > /path/to/secring.gpg + ``` + +2. **Get your Sonatype user tokens:** + - Go to https://central.sonatype.com/usertoken + - Click "Generate User Token" + - Save the username and password + +3. **Create `export_signing.sh`:** + ```bash + #!/bin/bash + + # Configuration + SIGNING_KEY_FILE="/path/to/secring.gpg" + SIGNING_KEY_ID="8E72E6C6" # Last 8 chars of your GPG key ID + SIGNING_KEY_PASSWORD="your_gpg_passphrase" + + # Maven Central credentials (Sonatype user tokens) + export ORG_GRADLE_PROJECT_mavenCentralUsername="your_token_username" + export ORG_GRADLE_PROJECT_mavenCentralPassword="your_token_password" + + # GPG signing configuration + export ORG_GRADLE_PROJECT_signingInMemoryKey=$(cat "$SIGNING_KEY_FILE") + export ORG_GRADLE_PROJECT_signingInMemoryKeyId="$SIGNING_KEY_ID" + export ORG_GRADLE_PROJECT_signingInMemoryKeyPassword="$SIGNING_KEY_PASSWORD" + + echo "Signing environment variables exported successfully" + ``` + +4. **Make it executable:** + ```bash + chmod +x export_signing.sh + ``` + +## Usage + +Run the upload script: +```bash +./.buildscript/upload_archives.sh +``` + +The script automatically sources `export_signing.sh` to set up signing. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a5844a..876676c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ coroutines = "1.8.1" [libraries] kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka-gradle" } -maven-publish-gradle = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.14.2" } +maven-publish-gradle = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.28.0" } junit = { module = "junit:junit", version = "4.12" } truth = { module = "com.google.truth:truth", version = "1.0.1" } rxjava = { module = "io.reactivex.rxjava3:rxjava", version = "3.0.4" }