-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.35 KB
/
maven-publish.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
name: Maven Package
on:
push:
branches:
- master
- experimental
pull_request:
branches:
- master
- experimental
release:
types:
- prereleased
- created
- published
- edited
jobs:
build:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
- name: Create Target Directory
run: mkdir -p target
- name: Build with Maven
run: mvn verify --file ../pom.xml
working-directory: target
- name: Create filtered-artifacts
run: mkdir -p filtered-artifacts
- name: Filter and Upload JAR as an artifact
run: |
# Filter out files that start with 'Wauh' and upload the rest
find -type f -name Wauh*.jar -exec cp {} filtered-artifacts/ \;
- name: Upload JAR as an artifact
uses: actions/upload-artifact@v3
with:
name: Wauh-${{ github.run_number }}
path: filtered-artifacts
if-no-files-found: error