-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (44 loc) · 1.25 KB
/
java_build.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
name: Java-Build
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11.0.13
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11.0.13'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B package -Dmaven.javadoc.skip --file pom.xml
- name: Tar moka
run: tar -cvf moka.tar modules/* moka moka.bat; gzip moka.tar
- name: Tar blue
run: tar --transform='s/moka$/blue/' --transform='s/moka.bat$/blue.bat/' -cvf blue.tar modules/* moka moka.bat; gzip blue.tar
- name: Upload moka
uses: actions/upload-artifact@v3
with:
name: moka
path: moka.tar.gz
if: always()
- name: Upload blue
uses: actions/upload-artifact@v3
with:
name: blue
path: blue.tar.gz
if: always()