From 68645f0550a5549e947e4a9100dd76fb58162063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Sv=C4=9Bcen=C3=BD?= Date: Wed, 20 Apr 2022 16:11:00 +0200 Subject: [PATCH] Use environment variables in all CI steps --- .github/workflows/publish.yml | 18 +++++++++--------- hubspot/build.gradle.kts | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 161c474..56e6f62 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,15 @@ on: release: types: [ published ] +env: + # Gradle GPG Keys + GRADLE_GPG_SIGN_KEY: ${{ secrets.GRADLE_GPG_SIGN_KEY }} + GRADLE_GPG_SIGN_PASSWORD: ${{ secrets.GRADLE_GPG_SIGN_PASSWORD }} + + # Sonatype + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + jobs: build: runs-on: ubuntu-latest @@ -25,14 +34,5 @@ jobs: working-directory: ./hubspot - name: Publish library - env: - # Gradle GPG Keys - GRADLE_GPG_SIGN_KEY: ${{ secrets.GRADLE_GPG_SIGN_KEY }} - GRADLE_GPG_SIGN_PASSWORD: ${{ secrets.GRADLE_GPG_SIGN_PASSWORD }} - - # Sonatype - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - run: ./gradlew publish working-directory: ./hubspot diff --git a/hubspot/build.gradle.kts b/hubspot/build.gradle.kts index 7b777cc..2a224da 100644 --- a/hubspot/build.gradle.kts +++ b/hubspot/build.gradle.kts @@ -41,8 +41,8 @@ java { } signing { - val signingKey: String = System.getenv("GRADLE_GPG_SIGN_KEY") - val signingPassword: String = System.getenv("GRADLE_GPG_SIGN_PASSWORD") + val signingKey: String? = System.getenv("GRADLE_GPG_SIGN_KEY") + val signingPassword: String? = System.getenv("GRADLE_GPG_SIGN_PASSWORD") useInMemoryPgpKeys(signingKey, signingPassword)