Skip to content

Commit

Permalink
Try using .vars and rename for jreleaser (#184)
Browse files Browse the repository at this point in the history
* Try using .vars and rename for jreleaser

* Use jreleaser specific env variables

* Use jreleaser specific env variables

---------

Signed-off-by: Matthew Burkert <[email protected]>
  • Loading branch information
mburkert3 authored Dec 13, 2024
1 parent 00c89b4 commit 2e8c08b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
run: ./gradlew jreleaserFullRelease -Dorg.gradle.daemon=false --stacktrace -x test -x integrationTest
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PUBLIC_KEY: ${{ env.GPG_PUBLIC_KEY }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ vars.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SIGNING_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}

Expand Down
25 changes: 5 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ jreleaser {
signing {
active = 'ALWAYS'
armored = true
def publicKey = System.getenv('GPG_PUBLIC_KEY')?.decodeBase64() ?
new String(System.getenv('GPG_PUBLIC_KEY').decodeBase64()) : ''
def secretKey = System.getenv('GPG_SIGNING_KEY')?.decodeBase64() ?
new String(System.getenv('GPG_SIGNING_KEY').decodeBase64()) : ''
def publicKey = System.getenv('JRELEASER_GPG_PUBLIC_KEY')?.decodeBase64() ?
new String(System.getenv('JRELEASER_GPG_PUBLIC_KEY').decodeBase64()) : ''
def secretKey = System.getenv('JRELEASER_GPG_SECRET_KEY')?.decodeBase64() ?
new String(System.getenv('JRELEASER_GPG_SECRET_KEY').decodeBase64()) : ''

if (publicKey) {
System.setProperty('jreleaser.gpg.public.key', publicKey)
Expand All @@ -168,28 +168,13 @@ jreleaser {
System.setProperty('jreleaser.gpg.secret.key', secretKey)
}

def passphrase = System.getenv('GPG_PASSPHRASE')
if (passphrase) {
System.setProperty('jreleaser.gpg.passphrase', passphrase)
}
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
def sonatype_user = System.getenv('JRELEASER_MAVENCENTRAL_USERNAME')
def sonatype_pass = System.getenv('JRELEASER_MAVENCENTRAL_PASSWORD')
if (sonatype_user) {
System.setProperty('jreleaser.mavencentral.username', sonatype_user)
}
if (sonatype_pass) {
System.setProperty('jreleaser.mavencentral.password', sonatype_pass)
}
if (!sonatype_user || !sonatype_pass) {
logger.warn('Sonatype credentials are missing. This may cause deployment issues.')
}
verifyPom = false
stagingRepository('build/staging-deploy')
}
Expand All @@ -199,4 +184,4 @@ jreleaser {
}

afterReleaseBuild.dependsOn publish
publish.finalizedBy publishPlugins
// publish.finalizedBy publishPlugins

0 comments on commit 2e8c08b

Please sign in to comment.