-
Notifications
You must be signed in to change notification settings - Fork 9
137 lines (126 loc) · 3.88 KB
/
gradle.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Master Build
on:
workflow_dispatch:
push:
branches: [ master ]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
gradleValidation:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
with:
min-wrapper-count: 0
build:
name: Build ${{ matrix.tag }}
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.ignore-errors }}
strategy:
matrix:
os: ['linux']
arch: ['amd64']
runner: ['ubuntu-latest']
tag: ['linux-amd64']
ignore-errors: [false]
include:
- os: macos
runner: macos-latest
arch: amd64
tag: darwin-amd64
ignore-errors: true
- os: macos
runner: macos-14
arch: aarch64
tag: darwin-aarch64
ignore-errors: true
- os: windows
runner: windows-latest
arch: amd64
tag: windows-amd64
ignore-errors: true
steps:
- uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
- name: Setup JVM
uses: actions/setup-java@v4
with:
distribution : zulu
java-version: |
21
17
- name : Setup Gradle
uses : gradle/actions/setup-gradle@v4
- run: ./gradlew build
# - name: list build directory
# if: ${{ always() }}
# run: |
# ls build
- name: Upload Test Report
uses: actions/upload-artifact@v4
if: always() # always run even if the previous step fails
with:
name: junit-test-results-${{ matrix.tag }}
path: '**/build/test-results/test/TEST-*.xml'
retention-days: 1
# This job will update the PR with the JUnit report
# In order to be able to make the most of it this job in particular has
# augmented permissions.
junit-report:
name: JUnit Report ${{ matrix.tag }}
runs-on: ubuntu-latest
strategy:
matrix:
tag: ['linux-amd64', 'darwin-amd64', 'darwin-aarch64', 'windows-amd64']
if: |
success() || failure()
needs: [ build ]
permissions:
checks: write # for mikepenz/action-junit-report
steps:
- name: Download Test Report
uses: actions/download-artifact@v4
with:
name: junit-test-results-${{ matrix.tag }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
with:
check_name: Test Report - ${{ matrix.tag }}
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '**/build/test-results/test/TEST-*.xml'
publish:
name: Publish snapshots
runs-on: ubuntu-latest
needs: build
if: success() && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JVM
uses: actions/setup-java@v4
with:
distribution : zulu
java-version: |
21
17
- name : Setup Gradle
uses : gradle/actions/setup-gradle@v4
- run: ./gradlew snapshot -Ppublish.central=true
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHUSERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHPASSWORD }}