Skip to content

Commit f3f949e

Browse files
committed
Merge branch 'improvement/ARTESCA-14946-build-shellui-SBOM' into q/130.0
2 parents 42d3c28 + 2109d59 commit f3f949e

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/build-shell-ui.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,33 @@ jobs:
4141
run: >
4242
docker save shell-ui:v$SHELL_UI_VERSION |
4343
gzip > shell-ui.tar.gz
44+
- name: Install syft tool to build the sbom
45+
run: |
46+
SYFT_VERSION="1.19.0"
47+
SYFT_INSTALLER="syft_${SYFT_VERSION}_linux_amd64.deb"
48+
SYFT_CHECKSUM="f3667d6abfa97a1e5614882f81e0a0b090f0047e0df7025b568fa87b6d95ac58"
49+
wget https://github.com/anchore/syft/releases/download/v${SYFT_VERSION}/${SYFT_INSTALLER}
50+
ACTUAL_CHECKSUM=$(sha256sum ${SYFT_INSTALLER} | cut -d ' ' -f1)
51+
if [ "$ACTUAL_CHECKSUM" != "$SYFT_CHECKSUM" ]; then
52+
echo "ERROR: Checksum verification failed for ${SYFT_INSTALLER}"
53+
echo "Expected: ${SYFT_CHECKSUM}"
54+
echo "Got: ${ACTUAL_CHECKSUM}"
55+
exit 1
56+
fi
57+
sudo dpkg -i ${SYFT_INSTALLER}
58+
- name: "build Software Bill of materials (SBOM)"
59+
run: |
60+
set -x
61+
cd shell-ui
62+
syft scan dir:./ --source-name=shell-ui --source-version "$SHELL_UI_VERSION" --output cyclonedx-json=../shell.tar.sbom.spdx.json
63+
4464
- name: Prepare artifacts
45-
run: mkdir -p "artifacts/images" && mv shell-ui.tar.gz artifacts/images/ && mv shell.tar artifacts/images/
65+
run: |
66+
mkdir -p "artifacts/images"
67+
mv shell-ui.tar.gz artifacts/images/
68+
mv shell.tar artifacts/images/
69+
mv shell.tar.sbom.spdx.json artifacts/images/
70+
4671
- name: Upload artifacts
4772
uses: scality/action-artifacts@v4
4873
with:

.github/workflows/publish.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ jobs:
5858
run: >
5959
curl --fail -LO -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }}
6060
${{ inputs.artifacts-url || steps.artifacts.outputs.link }}/images/shell.tar
61+
- name: Retrieve shell SBOM from artifacts
62+
run: >
63+
curl --fail -LO -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }}
64+
${{ inputs.artifacts-url || steps.artifacts.outputs.link }}/images/shell.tar.sbom.spdx.json
6165
- name: Load shell-ui image
6266
run: docker load < shell-ui.tar.gz
6367
- name: Retrieve product.txt from artifacts
@@ -149,5 +153,6 @@ jobs:
149153
draft: false
150154
files: |
151155
shell.tar
156+
shell.tar.sbom.spdx.json
152157
env:
153158
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)