-
Notifications
You must be signed in to change notification settings - Fork 28
47 lines (45 loc) · 1.33 KB
/
build.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
name: Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Spotless Check
run: ./gradlew spotlessCheck
- name: Test
run: ./gradlew test --rerun-tasks
- name: Build
run: ./gradlew generatePomFileForMavenJavaPublication build
publish:
runs-on: ubuntu-latest
environment: Sonatype
needs: build
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Set up OpenJDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Publish to Sonatype
run: ./publish-sonatype.sh