Skip to content

Commit

Permalink
Adjustments to build.gradle, removed old gradle.yml using gradle-chec…
Browse files Browse the repository at this point in the history
…k.yml instead.
  • Loading branch information
sbglasius committed Dec 30, 2023
1 parent 7ac5a68 commit d29fa9b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 72 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
distribution: temurin
java-version: 8
- uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew check
with:
arguments: check
47 changes: 0 additions & 47 deletions .github/workflows/gradle.yml

This file was deleted.

42 changes: 19 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,37 +109,33 @@ publishing {
}
}

ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY_ID')
ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg")

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

afterEvaluate {
signing {
required { isReleaseVersion }
sign publishing.publications.maven
}
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository

tasks.withType(InitializeNexusStagingRepository).configureEach {
onlyIf { isReleaseVersion }
shouldRunAfter(tasks.withType(Sign))
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}

nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: ''

nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileIdExternalConfig") ? project.sonatypeOssStagingProfileIdExternalConfig : ''

nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}

asciidoctor {
Expand Down Expand Up @@ -169,7 +165,7 @@ asciidoctor.dependsOn(apiDocs)

task snapshotVersion {
doLast {
if (!project.version.endsWith('-SNAPSHOT')) {
if (isReleaseVersion) {
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: "${project.version}-SNAPSHOT")
}
Expand Down

0 comments on commit d29fa9b

Please sign in to comment.