1111#
1212# -----------------------------------------------------------------------------
1313
14- name : Docker Build
14+ name : SW360 Container
1515
1616on :
1717 schedule :
@@ -61,14 +61,18 @@ jobs:
6161 - name : Get revision from pom.xml
6262 id : pom_version
6363 run : |
64- echo "SW360_VERSION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)" >> "$GITHUB_OUTPUT "
64+ echo "SW360_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV "
6565
66- thrift_image :
67- name : Build SW360 Thrift image
66+ binary_image :
67+ name : SW360 Binary
68+ needs : [sw360_version]
6869 runs-on : ubuntu-24.04
6970 permissions :
7071 packages : write
7172
73+ env :
74+ SW360_VERSION : ${{ needs.sw360_version.outputs.sw360_version }}
75+
7276 steps :
7377 - name : Harden Runner
7478 uses : step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
@@ -77,65 +81,53 @@ jobs:
7781
7882 - name : Checkout main repository
7983 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80- - name : Set environment variables
81- run : |
82- cat .versions >> $GITHUB_ENV
8384
84- - name : Build thrift image
85- uses : heliocastro/ docker-build-control@923d1cff454145d261107495786218d712fb4799 # v6.0
85+ - name : Login to GitHub container registry
86+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
8687 with :
87- name : thrift
88- target : localthrift
89- token : ${{ secrets.GITHUB_TOKEN }}
90- version : ${{ env.THRIFT_VERSION }}
91- invalidate-cache : ${{ inputs.invalidate-cache }}
92- debug : ${{ inputs.debug }}
93- build-args : |
94- THRIFT_VERSION=${{ env.THRIFT_VERSION }}
88+ registry : ${{ env.REGISTRY }}
89+ username : ${{ github.actor }}
90+ password : ${{ secrets.GITHUB_TOKEN }}
9591
96- binary_image :
97- name : SW360 Binary
98- needs : [sw360_version, thrift_image]
99- runs-on : ubuntu-24.04
100- permissions :
101- packages : write
92+ - name : Set up Docker build
93+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
10294
103- steps :
104- - name : Harden Runner
105- uses : step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
95+ - name : Extract components metadata (tags, labels)
96+ id : meta
97+ uses : docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
10698 with :
107- egress-policy : audit
108-
109- - name : Checkout main repository
110- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
111-
112- - name : Set environment variables
113- run : |
114- cat .versions >> $GITHUB_ENV
99+ images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/thrift
100+ tags : |
101+ type=schedule,pattern={{date 'YYYYMMDD'}}
102+ type=schedule,pattern=snapshot
103+ type=semver,pattern={{ env.SW360_VERSION }}
104+ type=raw,value=${{ env.SW360_VERSION }}
105+ type=ref,event=tag
106+ labels : sw360,thrift
115107
116- - name : Build binary image
117- uses : heliocastro/ docker- build-control@944a0451eadb63cf4f45a8ca66dba07118740faf # v5.1
108+ - name : Build image
109+ uses : docker/ build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
118110 with :
119- name : binaries
120- version : ${{ env.SW360_VERSION }}
121- token : ${{ secrets.GITHUB_TOKEN }}
122- invalidate-cache : ${{ inputs.invalidate-cache }}
123- debug : ${{ inputs.debug }}
124- platforms : " linux/amd64,linux/arm64 "
125- build-args : |
126- THRIFT_VERSION=${{ env.THRIFT_VERSION }}
127- SW360_VERSION=${{ env.SHORT_SHA }}
111+ context : .
112+ push : false
113+ load : true
114+ tags : |
115+ ${{ steps.meta.outputs.tags }}
116+ labels : |
117+ ${{ steps.meta.outputs.labels }}
118+ provenance : mode=max
119+ sbom : true
128120 secret-files : |
129121 "couchdb=./config/couchdb/default_secrets"
130- build-contexts : |
131- localthrift=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/thrift:${{ env.THRIFT_VERSION }}
132122
133- runtime_image :
123+ sw360_image :
134124 name : SW360 Runtime image
135125 needs : [sw360_version, binary_image]
136126 runs-on : ubuntu-24.04
137127 permissions :
138128 packages : write
129+ env :
130+ SW360_VERSION : ${{ needs.sw360_version.outputs.sw360_version }}
139131
140132 steps :
141133 - name : Harden Runner
@@ -146,20 +138,19 @@ jobs:
146138 - name : Checkout main repository
147139 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
148140
149- - name : Set environment variables
150- run : |
151- cat .versions >> $GITHUB_ENV
152-
153- - name : Set up Docker Buildx
154- uses : docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
155-
156141 - name : Login to GitHub Container Registry
157142 uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
158143 with :
159144 registry : ${{ env.REGISTRY }}
160145 username : ${{ github.actor }}
161146 password : ${{ secrets.GITHUB_TOKEN }}
162147
148+ - name : Setup QEMU
149+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
150+
151+ - name : Set up Docker Buildx
152+ uses : docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
153+
163154 - name : Extract components metadata (tags, labels) runtime image
164155 id : meta_runtime
165156 uses : docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
@@ -173,7 +164,7 @@ jobs:
173164 type=sha,enable=true,prefix=sha-,format=short
174165 type=ref,event=tag
175166
176- - name : Build image
167+ - name : Assembly image
177168 uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
178169 with :
179170 context : .
0 commit comments