forked from springdoc/springdoc-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.54 KB
/
Copy pathbuild.yml
File metadata and controls
57 lines (50 loc) · 1.54 KB
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
name: Build
on:
push:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'docs/**'
- '**.adoc'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'docs/**'
- '**.adoc'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 25 ]
steps:
- uses: actions/checkout@v7
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-read-only: ${{ github.event_name == 'pull_request' }}
- name: Build and test plugins
uses: ./.github/actions/build-and-test-plugins
- name: Deploy SNAPSHOT to Maven Central
if: github.event_name == 'push' && matrix.java == 17
run: |
MY_POM_VERSION=$(./mvnw -q -DforceStdout help:evaluate -Dexpression=project.version --non-recursive)
echo "POM VERSION: $MY_POM_VERSION"
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; then
./mvnw --no-transfer-progress -B -T 1C -Dinvoker.skip=true -DskipTests deploy -e
else
echo "Not a SNAPSHOT version, skipping deployment."
fi
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}