Skip to content

Commit

Permalink
Dont sign test builds (#398)
Browse files Browse the repository at this point in the history
* Don't sign the local publish in tests

* Update workflow
  • Loading branch information
samhill303 authored Jun 7, 2024
1 parent 3bc8ab4 commit f124f6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ jobs:
CI: "true"
- name: Local Publish For Samples
if: matrix.os == 'macOS-latest'
run: ./gradlew publishToMavenLocal --no-daemon --stacktrace --build-cache
run: ./gradlew publishToMavenLocal --no-daemon --stacktrace --build-cache -PRELEASE_SIGNING_ENABLED=false
env:
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
S3_BUILD_CACHE_AWS_REGION: ${{ secrets.S3_BUILD_CACHE_AWS_REGION }}
S3_BUILD_CACHE_BUCKET_NAME: ${{ secrets.S3_BUILD_CACHE_BUCKET_NAME }}
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
Expand Down
8 changes: 7 additions & 1 deletion gradle/gradle-mvn-mpp-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ def getAwsSecretKey() {
return hasProperty('AWS_SECRET_KEY') ? AWS_SECRET_KEY :
""
}

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def releaseSigningRequired() {
def enabled = hasProperty('RELEASE_SIGNING_ENABLED') ? RELEASE_SIGNING_ENABLED : false
return isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") && enabled
}

def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL :
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"
Expand Down Expand Up @@ -53,7 +59,7 @@ def getGpgKey() {
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
required { releaseSigningRequired() }
def gpgKey = getGpgKey()
if(gpgKey != "") {
useInMemoryPgpKeys(getGpgKey(), "")
Expand Down

0 comments on commit f124f6f

Please sign in to comment.