From eab3580749d7d994f773760ea692d9027bde38fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Sat, 1 May 2021 23:56:18 +0200 Subject: [PATCH] Add deploy to sonatype workflow --- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..1a2aaea5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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