-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.25 KB
/
main.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
53
54
55
56
57
name: Build and Upload JAR
on:
push:
branches:
- main
paths:
- 'lib/**'
- 'build.gradle'
- '.github/workflows/main.yml'
pull_request:
branches:
- '*'
paths:
- 'lib/**'
- 'build.gradle'
- '.github/workflows/main.yml'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Verify Gradle installation
run: ./gradlew --version
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run build
run: chmod +x ./gradlew && ./gradlew build shadowJar
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
DO_NOT_TRACK: true
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: lib/build/libs/*.jar