-
Notifications
You must be signed in to change notification settings - Fork 9
61 lines (54 loc) · 1.71 KB
/
main.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
name: Build with Maven
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
platform: [ ubuntu-latest, windows-latest ]
java-version: [ 1.8 ]
runs-on: ${{ matrix.platform }}
env:
PLATFORM: ${{ matrix.platform }}
JAVA_VERSION: ${{ matrix.java-version }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: s4u/maven-settings-action@v2.2.0
with:
servers: |
[{
"id": "github-packages",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
properties: |
[
{ "maven.wagon.http.ssl.insecure": "true" },
{ "maven.wagon.http.ssl.allowall": "true" },
{ "maven.wagon.http.ssl.ignore.validity.dates": "true"}
]
githubServer: false
- name: Build with Maven
run: mvn -P github-packages --batch-mode install
- name: Publish package
run: mvn -P github-packages -DskipTests -B deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'release' && github.event.action == 'created' && matrix.os == 'ubuntu-latest'