-
Notifications
You must be signed in to change notification settings - Fork 20
44 lines (42 loc) · 1.11 KB
/
maven.yml
File metadata and controls
44 lines (42 loc) · 1.11 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
# Builds using maven
# Pass the arguments you wish to run to maven_commands variable, default command will be mvn install
---
name: Maven
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
build:
permissions:
contents: read
strategy:
matrix:
java: [8, 11, 17, 21]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
maven_commands: test javadoc:javadoc # default is install
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: 'maven'
- name: Build
run: mvn ${{ env.maven_commands }}
release:
permissions:
contents: write
needs: build
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create a GitHub release
run: gh release create --generate-notes "${GITHUB_REF#refs/tags/}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}