Skip to content

Commit

Permalink
First try
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchaub committed Jul 5, 2023
1 parent 4d689e2 commit c190744
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/publish-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
name: Publish package to the Maven Central Repository
on:
push:
branches: [ "main" ]
#release: //TODO: change to this, only running at release when fully tested
#branches: [ "main" ] #TODO: commented out for testing on separate branch
#release: #TODO: change to this, only running at release when fully tested
#types: [created]
jobs:
publish:
Expand All @@ -28,11 +28,18 @@ jobs:
run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Publish package
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 #from the tutorial
#uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 #this is the action used in the other yml file, the Gradle build
with:
arguments: publish
env:
MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
#- name: Publish package
#uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 #from the tutorial
##uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 #this is the action used in the other yml file, the Gradle build
#with:
#arguments: publish
#env:
#MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
#MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
- name: Publish with Gradle
env:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRHPASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRHUSERNAME }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
run: ./gradlew publishToSonatype --no-daemon
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ publishing {
}

signing {
//uses keys and passwords declared in userhome/.gradle/gradle.properties
//uses keys and passwords declared in userhome/.gradle/gradle.properties, works locally
//sign publishing.publications.mavenJava

def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

0 comments on commit c190744

Please sign in to comment.