Skip to content

Commit ee34d81

Browse files
authored
Merge pull request #9 from sgubba01/sgubba01-patch-9
Update maven.yml
2 parents fc05244 + b94ad20 commit ee34d81

1 file changed

Lines changed: 33 additions & 37 deletions

File tree

.github/workflows/maven.yml

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
2-
3-
name: Java Maven Build & Publish Artifact
1+
name: Java Maven Build & Artifact Download
42

53
on:
64
push:
@@ -9,41 +7,39 @@ on:
97
branches: [ "main" ]
108

119
jobs:
12-
build_test:
10+
build:
11+
runs-on: ubuntu-latest
1312

13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Java 17
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: maven
23+
24+
- name: Build with Maven
25+
run: mvn -B package --file pom.xml
26+
27+
- name: Upload JAR Artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: my-built-jar
31+
path: target/*.jar
32+
33+
download:
1434
runs-on: ubuntu-latest
35+
needs: build
1536

1637
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up JDK 17
19-
uses: actions/setup-java@v3
20-
with:
21-
java-version: '17'
22-
distribution: 'temurin'
23-
cache: maven
24-
- name: Build with Maven
25-
run: mvn -B package --file pom.xml
26-
27-
publish-job:
28-
29-
runs-on: ubuntu-latest
30-
needs: build_test
31-
steps:
32-
- uses: actions/checkout@v3
33-
34-
- uses: actions/setup-java@v3
35-
with:
36-
java-version: '17'
37-
distribution: 'temurin'
38-
39-
- name: Build and test with Maven
40-
run: mvn --batch-mode --update-snapshots verify
41-
42-
- name: Upload build artifact
43-
uses: actions/upload-artifact@v3
44-
with:
45-
name: my-app-jar
46-
path: target/*.jar
47-
48-
49-
38+
- name: Download JAR Artifact
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: my-built-jar
42+
path: ./downloaded-artifacts
43+
44+
- name: List downloaded files
45+
run: ls -lh ./downloaded-artifacts

0 commit comments

Comments
 (0)