-
-
Notifications
You must be signed in to change notification settings - Fork 18
60 lines (49 loc) · 1.39 KB
/
publish-snapshots.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
name: Publish snapshots
on:
push:
branches:
- 'develop'
- 'feature/refactor'
permissions: read-all
jobs:
gradle:
name: Test with Java ${{ matrix.jdk }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: [ '11', '17', '21' ] # removed JDK due to plugin errors
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew check -x test --console=plain --warning-mode all
publish:
name: Publish Artifact
needs: gradle
if: ${{ needs.gradle.result == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build -x test publish
env:
GPR_USERNAME: benfortuna
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}