-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (32 loc) · 1.09 KB
/
maven.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
name: Java CI with Maven
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest, windows-latest]
java_version: [17, 21]
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java_version }}
cache: 'maven'
- name: Build with Maven
# Maven deploy on changes (or manual run) to master, otherwise just package it
run: mvn -s ".github/workflows/maven-settings.xml" -B ${{ (((github.event_name == 'push') || (github.event_name == 'workflow_dispatch')) && (github.ref == 'refs/heads/master') && (matrix.os == 'ubuntu-latest') && (matrix.java_version == '17')) && 'deploy' || 'package' }} --file pom.xml "-Prelease,release-snapshot"
env:
GITHUB_TOKEN: ${{ github.token }}