From d5fb700026a64caf9e12e445ab2c1425d8b99ac0 Mon Sep 17 00:00:00 2001 From: Vivchar Vitaly Date: Fri, 19 Jul 2024 23:39:44 +0700 Subject: [PATCH] add signing --- .github/workflows/gradle.yml | 15 ++++++++++++--- rendererrecyclerviewadapter/build.gradle.kts | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b7ec8ad..fd28594 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -5,7 +5,11 @@ on: branches: - master env: - TOKEN: ${{ secrets.MVNTOKEN }} + 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 }} jobs: build: @@ -21,8 +25,13 @@ jobs: distribution: 'adopt' java-version: '17' + - 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 + - name: Grant execute permission for gradlew run: chmod +x ./gradlew - - name: Build with Gradle - run: ./gradlew publish -Ptoken="$TOKEN" + - name: Publish with gradle + run: ./gradlew publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$TOKEN" diff --git a/rendererrecyclerviewadapter/build.gradle.kts b/rendererrecyclerviewadapter/build.gradle.kts index 245df29..92f6f02 100644 --- a/rendererrecyclerviewadapter/build.gradle.kts +++ b/rendererrecyclerviewadapter/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.android.kotlin) id("maven-publish") + id("signing") } android { @@ -34,6 +35,10 @@ dependencies { implementation(libs.androidx.recyclerview) } +signing { + sign(publishing.publications["release"]) +} + /** * https://issues.sonatype.org/browse/OSSRH-54875 * https://issues.sonatype.org/browse/OSSRH-67154