-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.95 KB
/
build_deploy.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: "Build and Deploy"
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'oracle' # See 'Supported distributions' for available options
java-version: '17'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with gradle
run: ./gradlew build --no-daemon
- uses: actions/setup-java@v3
with:
distribution: 'oracle' # See 'Supported distributions' for available options
java-version: '20'
- name: Run tests
run: ./gradlew test --no-daemon
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: JUnit Tests
path: build/test-results/test/*.xml
reporter: java-junit # Format of test results
publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'oracle'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Publish with Gradle
env:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
run: ./gradlew publishToSonatype --no-daemon