Update maven.yml

This commit is contained in:
potzplitz 2024-03-03 13:09:48 +01:00 committed by GitHub
parent e446409755
commit 2caca049b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,12 +1,4 @@
# 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
name: Java Maven Build & Publish Artifact
on:
push:
@ -15,10 +7,8 @@ on:
branches: [ "main" ]
jobs:
build:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
@ -29,7 +19,22 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: packaged-jar
path: target/*.jar
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
publish-job:
runs-on: ubuntu-latest
needs: build_test
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: packaged-jar
path: staging
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'