Add deploy to sonatype workflow

(cherry picked from commit eab3580749)
This commit is contained in:
Mikołaj Pich 2021-05-01 23:56:18 +02:00
parent 629d6fb560
commit 935a0734e5

31
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Deploy
on:
release:
types: [ created ]
jobs:
deploy-sonatype:
name: Deploy to sonatype
runs-on: ubuntu-latest
timeout-minutes: 10
environment: ossrh
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
- name: Build and publish
env:
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }}
MAVEN_SIGNING_PASSWORD: ${{ secrets.MAVEN_SIGNING_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --stacktrace