-
-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (45 loc) · 1.38 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
53
name: Java CI
on:
pull_request:
branches: ['**']
push:
branches: ['main']
tags: [v*]
jobs:
build:
name: Compile and Test code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- name: Build with Gradle
run: ./gradlew build --no-daemon
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@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- 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 publish --no-daemon