Skip to content

ci: add actions workflows #1

ci: add actions workflows

ci: add actions workflows #1

Workflow file for this run

name: Gradle build
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get JDK version
run: echo "JDK_VERSION=$(grep 'jdkVersion' gradle.properties | cut -d '=' -f2)" >> "$GITHUB_ENV"
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ env.JDK_VERSION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
validate-wrappers: true
gradle-home-cache-cleanup: true
add-job-summary-as-pr-comment: on-failure
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Publish snapshots
if: github.ref_name == 'main'
run: |
VERSION=$(grep 'version=' gradle.properties | cut -d '=' -f2)
if [[ $VERSION == *-SNAPSHOT ]]; then
./gradlew build
fi