59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
on:
|
|
push:
|
|
branches: [ develop, main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: linux
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '24'
|
|
distribution: 'temurin'
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
key: gradle-${{ hashFiles('**/libs.versions.toml') }}
|
|
restore-keys: gradle-
|
|
path: |
|
|
~/.gradle/caches/
|
|
~/.gradle/wrapper/
|
|
|
|
- name: Test
|
|
run: ./gradlew allTests
|
|
|
|
publish:
|
|
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
|
|
needs: test
|
|
runs-on: linux
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '24'
|
|
distribution: 'temurin'
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
key: gradle-${{ hashFiles('**/libs.versions.toml') }}
|
|
restore-keys: gradle-
|
|
path: |
|
|
~/.gradle/caches/
|
|
~/.gradle/wrapper/
|
|
|
|
- name: Publish
|
|
run: ./gradlew publish
|
|
env:
|
|
INFENDRO__TOKEN: ${{ secrets.TOKEN }}
|