Skip to content

Merge pull request #8 from Urban82/main #14

Merge pull request #8 from Urban82/main

Merge pull request #8 from Urban82/main #14

Workflow file for this run

name: Continuous integration and deployment
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Deploy from the main branch
if: github.ref == 'refs/heads/main'
run: ./gradlew publish -PsigningKey=${{ secrets.GPG_PRIVATE_KEY }} -PsigningPassword=${{secrets.GPG_PRIVATE_KEY_PASSPHRASE}} -PossrhUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }} -PossrhPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties