-
Notifications
You must be signed in to change notification settings - Fork 13
69 lines (55 loc) · 1.65 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
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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Maven Build
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
workflow_dispatch:
permissions:
contents: write
concurrency:
group: maven-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-jar:
name: jar / ${{ matrix.os }} / ${{ matrix.jdk-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
jdk-version: [ 21 ]
os:
- ubuntu-latest
- windows-latest
- macos-13 # Intel OSX
- macos-14 # ARM64 OSX
steps:
- uses: actions/checkout@v4
- name: Set Up JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'temurin'
- name: Cache Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ runner.arch }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-maven-
- name: Maven Build Jar
run: ./mvnw -V -B -e -ff -ntp clean package -Passembly
- name: Upload Jar
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jar
path: target/*-assembly.jar
retention-days: 10
if-no-files-found: error