From 789da8914a5de822deb31e523770a3f188b32568 Mon Sep 17 00:00:00 2001 From: Natalie Bunduwongse Date: Mon, 28 Nov 2022 11:10:17 +1100 Subject: [PATCH] ci: use system environments for release (#138) --- .github/workflows/release.yml | 10 +++++----- imx-core-sdk-kotlin-jvm/build.gradle | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 628755a..e451efb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,11 +16,11 @@ jobs: - run: ./gradlew publish env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_signing.keyId: ${{ secrets.SIGNING_KEY_ID }} - ORG_GRADLE_PROJECT_signing.key: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_signing.password: ${{ secrets.SIGNING_KEY_PASSWORD }} + SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} - name: Extract release notes id: release_notes diff --git a/imx-core-sdk-kotlin-jvm/build.gradle b/imx-core-sdk-kotlin-jvm/build.gradle index 3e07d7c..5d77153 100644 --- a/imx-core-sdk-kotlin-jvm/build.gradle +++ b/imx-core-sdk-kotlin-jvm/build.gradle @@ -153,11 +153,10 @@ publishing { signing { required !version.endsWith('SNAPSHOT') if (!version.endsWith('SNAPSHOT')) { - useInMemoryPgpKeys( - findProperty("signing.keyId"), - findProperty("signing.key"), - findProperty("signing.password"), - ) + def keyId = findProperty("signing.keyId") ?: System.getenv("SIGNING_KEY_ID") + def key = findProperty("signing.key") ?: System.getenv("SIGNING_KEY") + def password = findProperty("signing.key") ?: System.getenv("SIGNING_KEY_PASSWORD") + useInMemoryPgpKeys(keyId, key, password) sign publishing.publications } } @@ -171,8 +170,8 @@ publishing { url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { - username project.findProperty('mavenCentralUsername') - password project.findProperty('mavenCentralPassword') + username project.findProperty('mavenCentralUsername') ?: System.getenv("SONATYPE_NEXUS_USERNAME") + password project.findProperty('mavenCentralPassword') ?: System.getenv("SONATYPE_NEXUS_PASSWORD") } } }