-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.88 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
54
55
56
57
58
59
60
61
62
63
64
65
name: CI
on:
push:
pull_request:
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Download Java JDK
uses: typelevel/download-java@v2
id: download-java
with:
distribution: temurin
java-version: 11
- name: Setup Java JDK
uses: actions/setup-java@v3.11.0
with:
distribution: jdkfile
java-version: 11
jdkFile: ${{ steps.download-java.outputs.jdkFile }}
- name: Build & Test
uses: gradle/gradle-build-action@v2.6.0
with:
arguments: build
- name: Publish Test Results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: '**/build/test-results/*/TEST-*.xml'
- name: Publish To Sonatype
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: gradle/gradle-build-action@v2.6.0
with:
arguments: publishAllPublicationsToMavenCentral
- name: Publish To Gradle Plugin Portal
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
uses: gradle/gradle-build-action@v2.6.0
with:
arguments: |
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
publishPlugins