-
Notifications
You must be signed in to change notification settings - Fork 37
52 lines (49 loc) · 1.53 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
on:
push:
paths:
- src/**
- build.gradle
- gradle.properties
- settings.gradle
jobs:
build:
strategy:
matrix:
java: [ 17 ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/[email protected]
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup java ${{ matrix.java }}
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Setup cache
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Set build number
run: sed -i "s/undefined/$GITHUB_RUN_NUMBER/g" gradle.properties
- name: build
run: ./gradlew build
- name: Find correct JAR
id: find-jar
run: |
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
echo "jarname=$output" >> $GITHUB_OUTPUT
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
uses: actions/[email protected]
with:
name: ${{ steps.find-jar.outputs.jarname }}
path: build/libs/${{ steps.find-jar.outputs.jarname }}