Skip to content
43 changes: 43 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Maven CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build_and_test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14

- name: Build project with Maven
run: mvn -B package --file pom.xml

- name: list package
run: ls -ltr target

- name: Upload JAR as artifact
uses: actions/upload-artifact@v4
with:
name: built-jar
path: target/*.jar

- name: Download the JAR artifact
uses: actions/download-artifact@v4
with:
name: built-jar
path: ./downloaded-artifacts

- name: List downloaded artifact files
run: ls -la downloaded-artifacts
- name: Find out jars
run: |
JAR_FILE=$(ls downloaded-artifacts/*.jar | head -n 1)
echo "Running Veracode scan on $JAR_FILE"