-
Notifications
You must be signed in to change notification settings - Fork 30
51 lines (47 loc) · 1.62 KB
/
build.yml
File metadata and controls
51 lines (47 loc) · 1.62 KB
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
name: Veracode Build Artifact
run-name: Veracode Build Artifact
on:
repository_dispatch:
types: [veracode-build]
jobs:
register:
runs-on: ubuntu-latest
steps:
- uses: vincent-deng/veracode-github-app@aws-ecs-dynamodb
with:
callback_url: ${{ github.event.client_payload.callback_url }}
sha: ${{ github.event.client_payload.sha }}
branch: ${{ github.event.client_payload.branch }}
run_id: ${{ github.run_id }}
repository_owner: ${{ github.event.client_payload.repository.owner }}
repository_name: ${{ github.event.client_payload.repository.name }}
event_type: ${{ github.event.client_payload.event_type }}
build:
needs: register
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.sha }}
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven Dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
run: mvn clean package
- name: Get JAR file name
run: |
ARTIFACT_NAME=$( mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout )
ARTIFACT_VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )
echo "::set-env name=ARTIFACT_JAR_FILE::$ARTIFACT_NAME-$ARTIFACT_VERSION.jar"
- name: Upload JAR file
uses: actions/upload-artifact@v3
with:
name: veracode-artifact
path: target/$ARTIFACT_JAR_FILE