-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (50 loc) · 1.41 KB
/
gradle.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
on: [push, pull_request, create]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
jdk: [11]
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 9
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Execute tests
run: ./gradlew check
- name: Assemble fat jar
run: ./gradlew shadowJar
- name: Upload jars as artifact
uses: actions/upload-artifact@v2
with:
name: software-challenge-gui-${{ github.sha }}-jars
path: build/*.jar
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
with:
name: software-challenge-gui-${{ github.sha }}-jars
path: build
- name: Release ${{ github.ref }}
uses: softprops/action-gh-release@v1
with:
files: build/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}