-
Notifications
You must be signed in to change notification settings - Fork 14
133 lines (123 loc) · 3.98 KB
/
maven.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
name: "Build and Verify"
outputs:
sha_sort: ${{ steps.vars.outputs.sha_short }}
steps:
- uses: actions/checkout@v4
- name: Set vars
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Build with Maven
run: mvn --batch-mode -V -U verify -Dsurefire.useFile=false
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: "**/target/surefire-reports/**/*.xml"
- name: Archive Service
uses: actions/upload-artifact@v4
with:
name: dist-service
path: |
service/target/quarkus-app
- name: Archive CLI
uses: actions/upload-artifact@v4
with:
name: dist-cli
path: |
cli/target/quarkus-app
image-service:
runs-on: ubuntu-latest
name: "Image / Service"
needs: build
steps:
- uses: actions/checkout@v4
- name: Download Service
uses: actions/download-artifact@v4
with:
name: dist-service
path: service/target/quarkus-app
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: sbomer-service
tags: latest ${{ needs.build.outputs.sha_sort }}
containerfiles: |
./images/sbomer-service/Containerfile
- name: Push to Quay
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ secrets.REGISTRY_ORG_STAGE }}
username: ${{ secrets.REGISTRY_USER_STAGE }}
password: ${{ secrets.REGISTRY_PASSWORD_STAGE }}
image-cache:
runs-on: ubuntu-latest
name: "Image / Cache"
needs: build
steps:
- uses: actions/checkout@v4
- name: Populate certificates
run: echo $IT_ROOT_CA_2022 > images/sbomer-cache/2022-IT-Root-CA.pem
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: sbomer-cache
tags: latest ${{ needs.build.outputs.sha_sort }}
containerfiles: |
./images/sbomer-cache/Containerfile.gh
- name: Push to Quay
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ secrets.REGISTRY_ORG_STAGE }}
username: ${{ secrets.REGISTRY_USER_STAGE }}
password: ${{ secrets.REGISTRY_PASSWORD_STAGE }}
# image-generator:
# runs-on: ubuntu-latest
# name: "Image / Generator"
# needs: build
# steps:
# - uses: actions/checkout@v4
# - name: Download CLI
# uses: actions/download-artifact@v4
# with:
# name: dist-cli
# path: cli/target/quarkus-app
# - name: Build Image
# id: build-image
# uses: redhat-actions/buildah-build@v2
# with:
# image: sbomer-generator
# tags: latest ${{ needs.build.outputs.sha_sort }}
# containerfiles: |
# ./images/sbomer-generator/Containerfile
# - name: Push to Quay
# id: push-to-quay
# uses: redhat-actions/push-to-registry@v2
# with:
# image: ${{ steps.build-image.outputs.image }}
# tags: ${{ steps.build-image.outputs.tags }}
# registry: ${{ secrets.REGISTRY_ORG_STAGE }}
# username: ${{ secrets.REGISTRY_USER_STAGE }}
# password: ${{ secrets.REGISTRY_PASSWORD_STAGE }}