-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (48 loc) · 1.54 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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
schedule:
# each first day of month
- cron: "0 0 1 * *"
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
release:
types: [published]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11, 15 ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
submodules: 'true'
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Codecov
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
- name: Create Release
id: create_release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: "target/*.jar"
makeLatest: true