From a7307ea79bf64934330b36573d9fb6cbb71d7b72 Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Fri, 19 Jul 2024 23:45:01 +0700 Subject: [PATCH 01/10] fix input --- .github/workflows/gradle.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index fd28594..44b29c9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - maven env: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }} @@ -27,7 +28,7 @@ jobs: - name: Prepare environment run: | - echo '$SIGNING_SECRET_KEY_RING_CONTENT' | base64 -d > publish_key.gpg + echo '$SIGNING_SECRET_KEY_RING_CONTENT' | base64 -id > publish_key.gpg gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - name: Grant execute permission for gradlew From 4422a8254484dd2aab50ec948b88e0f0db9d30dc Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Fri, 19 Jul 2024 23:52:36 +0700 Subject: [PATCH 02/10] fix input --- .github/workflows/gradle.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 44b29c9..7072146 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -5,6 +5,7 @@ on: branches: - master - maven + env: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }} @@ -28,11 +29,11 @@ jobs: - name: Prepare environment run: | - echo '$SIGNING_SECRET_KEY_RING_CONTENT' | base64 -id > publish_key.gpg + echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - name: Grant execute permission for gradlew run: chmod +x ./gradlew - - name: Publish with gradle - run: ./gradlew publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$TOKEN" + - name: Publish with Gradle + run: ./gradlew publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" From f0b7c18fb94cc9c77e8de3d6d9bce1c9c2bb0af4 Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Fri, 19 Jul 2024 23:57:04 +0700 Subject: [PATCH 03/10] fix sign section --- rendererrecyclerviewadapter/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rendererrecyclerviewadapter/build.gradle.kts b/rendererrecyclerviewadapter/build.gradle.kts index 92f6f02..7317cf6 100644 --- a/rendererrecyclerviewadapter/build.gradle.kts +++ b/rendererrecyclerviewadapter/build.gradle.kts @@ -36,7 +36,7 @@ dependencies { } signing { - sign(publishing.publications["release"]) + sign(publishing.publications) } /** From 78a1e344528f255f5b6e68a78785b035fd44da51 Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 00:03:19 +0700 Subject: [PATCH 04/10] add logs --- .github/workflows/gradle.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7072146..de3da51 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -30,10 +30,12 @@ jobs: - name: Prepare environment run: | echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg - gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg + ls -al + gpg --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg + ls -al - name: Grant execute permission for gradlew run: chmod +x ./gradlew - - name: Publish with Gradle - run: ./gradlew publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" + #- name: Publish with Gradle + # run: ./gradlew publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" From 177f557d54c8013f2bc6791f5eff3d068b2a333b Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 00:08:20 +0700 Subject: [PATCH 05/10] fix file location --- .github/workflows/gradle.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index de3da51..601021d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,7 +14,7 @@ env: SIGNING_SECRET_KEY_RING_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_RING_CONTENT }} jobs: - build: + publish: runs-on: ubuntu-latest steps: @@ -30,12 +30,10 @@ jobs: - name: Prepare environment run: | echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg - ls -al gpg --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - ls -al - name: Grant execute permission for gradlew run: chmod +x ./gradlew - #- name: Publish with Gradle - # run: ./gradlew publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" + - name: Publish with Gradle + run: ./gradlew publish -Psigning.secretKeyRingFile=../secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" From b2768be54bd38985846e9d473937a0e264cd048d Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 02:10:27 +0700 Subject: [PATCH 06/10] small changes --- .github/workflows/gradle.yml | 4 ++-- build.gradle.kts | 19 ++++++++++++++++++- gradle/libs.versions.toml | 4 +++- rendererrecyclerviewadapter/build.gradle.kts | 4 ++-- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 601021d..ed55d1e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -8,10 +8,10 @@ on: env: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} - SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }} SIGNING_KEYID: ${{ secrets.SIGNING_KEYID }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} SIGNING_SECRET_KEY_RING_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_RING_CONTENT }} + SIGNING_SECRET_PASSPHRASE: ${{ secrets.SIGNING_SECRET_PASSPHRASE }} jobs: publish: @@ -30,7 +30,7 @@ jobs: - name: Prepare environment run: | echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg - gpg --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg + gpg --batch --yes --decrypt --passphrase="SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - name: Grant execute permission for gradlew run: chmod +x ./gradlew diff --git a/build.gradle.kts b/build.gradle.kts index 8a29820..086f2ff 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,4 +2,21 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.android.kotlin) apply false -} \ No newline at end of file +// alias(libs.plugins.nexus.plugin) +} + +/** + * ./gradlew publishReleasePublicationToSonatypeRepository -Ptoken="token" + * ./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository -Ptoken="token" + * */ +//nexusPublishing { +// repositories { +// sonatype { +// group = "com.github.vivchar" /* for filters by description */ +// version = "3.0.3" /* for filters by description */ +// packageGroup = "com.github.vivchar" +// username = "Ud8EE3UN" +// password = findProperty("token") as String? +// } +// } +//} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 62c4d62..3614137 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,6 +27,7 @@ appcompat = "1.7.0" plugin-application = "8.5.1" plugin-library = "8.5.1" plugin-kotlin = "1.9.0" +plugin-nexus = "2.0.0" kotlinVersion = "1.9.24" @@ -58,4 +59,5 @@ glide-transformations = { group = "jp.wasabeef", name = "glide-transformations", [plugins] android-kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "plugin-kotlin" } android-application = { id = "com.android.application", version.ref = "plugin-application" } -android-library = { id = "com.android.library", version.ref = "plugin-library" } \ No newline at end of file +android-library = { id = "com.android.library", version.ref = "plugin-library" } +nexus-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "plugin-nexus" } \ No newline at end of file diff --git a/rendererrecyclerviewadapter/build.gradle.kts b/rendererrecyclerviewadapter/build.gradle.kts index 7317cf6..f7aeac6 100644 --- a/rendererrecyclerviewadapter/build.gradle.kts +++ b/rendererrecyclerviewadapter/build.gradle.kts @@ -11,8 +11,6 @@ android { defaultConfig { minSdk = libs.versions.minSdkVersion.get().toInt() compileSdk = libs.versions.compileSdkVersion.get().toInt() - version = "3.0.2" -// version = "3.0.2-SNAPSHOT" } buildTypes { @@ -53,6 +51,8 @@ publishing { groupId = "com.github.vivchar" artifactId = "RendererRecyclerViewAdapter" + version = "3.0.3" +// version = "3.0.2-SNAPSHOT" pom { packaging = "aar" From 17438e585f044bfdf0f6d8c0b194f371949b0fb7 Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 05:01:43 +0700 Subject: [PATCH 07/10] log version --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ed55d1e..09e72bd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -30,6 +30,7 @@ jobs: - name: Prepare environment run: | echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg + gpg --version gpg --batch --yes --decrypt --passphrase="SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - name: Grant execute permission for gradlew From 71e3b3ce953c3013145257284c6823c4e7cbc566 Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 05:07:34 +0700 Subject: [PATCH 08/10] add a flag --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 09e72bd..dbd1092 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -31,7 +31,7 @@ jobs: run: | echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg gpg --version - gpg --batch --yes --decrypt --passphrase="SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg + gpg --pinentry loopback --batch --yes --decrypt --passphrase="SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - name: Grant execute permission for gradlew run: chmod +x ./gradlew From 3ada7292518e4e289a732a74600338334bc2937c Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 05:15:11 +0700 Subject: [PATCH 09/10] fix pass --- .github/workflows/gradle.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index dbd1092..fc9f9ac 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -27,14 +27,13 @@ jobs: distribution: 'adopt' java-version: '17' - - name: Prepare environment + - name: Prepare environment # https://habr.com/ru/articles/490604/ run: | echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg - gpg --version - gpg --pinentry loopback --batch --yes --decrypt --passphrase="SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg + gpg --batch --yes --decrypt --passphrase="$SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg - name: Grant execute permission for gradlew run: chmod +x ./gradlew - name: Publish with Gradle - run: ./gradlew publish -Psigning.secretKeyRingFile=../secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" + run: ./gradlew publish -Psigning.secretKeyRingFile=../secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN" \ No newline at end of file From 7b68d47b6eb36da276e490a408607008d6fdd82d Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Sat, 20 Jul 2024 18:18:46 +0700 Subject: [PATCH 10/10] cleanup before merge --- .github/workflows/gradle.yml | 1 - build.gradle.kts | 2 +- rendererrecyclerviewadapter/build.gradle.kts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index fc9f9ac..3e2bc2f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - maven env: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 086f2ff..62e1b6a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ plugins { // repositories { // sonatype { // group = "com.github.vivchar" /* for filters by description */ -// version = "3.0.3" /* for filters by description */ +// version = "3.0.2" /* for filters by description */ // packageGroup = "com.github.vivchar" // username = "Ud8EE3UN" // password = findProperty("token") as String? diff --git a/rendererrecyclerviewadapter/build.gradle.kts b/rendererrecyclerviewadapter/build.gradle.kts index f7aeac6..a690f5f 100644 --- a/rendererrecyclerviewadapter/build.gradle.kts +++ b/rendererrecyclerviewadapter/build.gradle.kts @@ -51,7 +51,7 @@ publishing { groupId = "com.github.vivchar" artifactId = "RendererRecyclerViewAdapter" - version = "3.0.3" + version = "3.0.2" // version = "3.0.2-SNAPSHOT" pom {