Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish package to the Maven Central Repository | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "8" | |
distribution: "adopt" | |
#Authorizing gradlew files | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
#Build project | |
- name: Build with Gradle | |
run: ./gradlew build | |
#After decoding the secret key, place the file in ~ /. Gradle/ secring.gpg | |
- name: Decode | |
run: | | |
echo "${{secrets.SIGNING_SECRET_KEY_RING_FILE}}" > ~/.gradle/secring.gpg.b64 | |
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg | |
- name: Publish package | |
run: ./gradlew publishToSonatype closeAndReleaseStagingRepository -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_KEY_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) -Dorg.gradle.internal.http.socketTimeout=300000 --stacktrace | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |