Skip to content

Commit 71f840e

Browse files
committed
Merge branch 'refs/heads/master' into release-1.0.0
# Conflicts: # .github/workflows/sbom.yml # Cargo.lock # Cargo.toml # Dockerfile # action.yml # docs/CommandLineHelp.md # docs/EdgeApps.md
2 parents be75278 + a54d2dd commit 71f840e

File tree

3 files changed

+109
-19
lines changed

3 files changed

+109
-19
lines changed

.github/workflows/sbom.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,57 @@ name: Generate SBOMs
33

44
on:
55
push:
6-
branches:
7-
- master
8-
paths:
9-
- 'Cargo.lock'
6+
tags:
7+
- 'v*'
108

119
jobs:
1210
sbom:
1311
runs-on: ubuntu-latest
1412
steps:
1513
- uses: actions/checkout@v3
1614

17-
- uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.10'
20-
cache: 'pip'
15+
- name: Install cyclonedx-rust-cargo
16+
run: |
17+
cargo install cargo-cyclonedx
2118
22-
- name: Install sbom4rust
19+
- name: Generate SBOM
2320
run: |
24-
pip install git+https://github.com/anthonyharrison/sbom4rust.git
21+
cargo cyclonedx \
22+
--spec-version 1.6 \
23+
-f json
2524
26-
- name: Run sbom4rust
25+
- name: Enrich and clean up SBOM
2726
run: |
28-
sbom4rust -a screenly-cli --sbom spdx --format json -o sbom.spdx.json
29-
sbom4rust -a screenly-cli --sbom cyclonedx --format json -o sbom.cyclonedx.json
3027
31-
- name: Upload SPDX SBOM
32-
uses: actions/upload-artifact@v3
33-
with:
34-
name: cli-SPDX
35-
path: sbom.spdx.json
28+
# Grab the version
29+
export VERSION_TAG="${GITHUB_REF#refs/*/}"
30+
export VERION=$(echo $VERSION_TAG | sed 's/^v//g')
31+
32+
# Delete unnecessary metadata.component.components.
33+
jq 'del(.metadata.component.components)' \
34+
screenly.cdx.json \
35+
> screenly.cdx.json.tmp
36+
mv screenly.cdx.json.tmp screenly.cdx.json
37+
38+
# Render SBOM metadata template
39+
cat sbom/metadata.cdx.json.tmpl | jq | \
40+
envsubst > metadata.cdx.json
41+
42+
# Merge in CycloneDX Metadata
43+
jq --slurp '.[0] * .[1]' \
44+
screenly.cdx.json \
45+
metadata.cdx.json \
46+
> screenly-cli.cdx.json
3647
3748
- name: Upload CycloneDX SBOM
3849
uses: actions/upload-artifact@v3
3950
with:
4051
name: cli-CycloneDX
41-
path: sbom.cyclonedx.json
52+
path: screenly-cli.cdx.json
53+
54+
- name: Upload SBOM
55+
uses: sbomify/github-action@master
56+
with:
57+
token: ${{ secrets.SBOMIFY_TOKEN }}
58+
sbom-file: 'screenly-cli.cdx.json'
59+
component-id: 'UUzAdk8ixV'

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[![sbomified](https://sbomify.com/assets/images/logo/badge.svg)](https://app.sbomify.com/component/UUzAdk8ixV)
2+
[![Lint](https://github.com/Screenly/cli/actions/workflows/lint.yml/badge.svg)](https://github.com/Screenly/cli/actions/workflows/lint.yml)
3+
[![Rust](https://github.com/Screenly/cli/actions/workflows/rust.yml/badge.svg)](https://github.com/Screenly/cli/actions/workflows/rust.yml)
4+
[![Nix](https://github.com/Screenly/cli/actions/workflows/nix.yml/badge.svg)](https://github.com/Screenly/cli/actions/workflows/nix.yml)
5+
16
# Screenly Command Line Interface (CLI)
27

38
The Screenly CLI simplifies interactions with Screenly through your terminal, designed for both manual use and task automation.

sbom/metadata.cdx.json.tmpl

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3+
"metadata": {
4+
"manufacture": {
5+
"name": "Screenly, Inc",
6+
"url": "https://www.screenly.io"
7+
},
8+
"lifecycles": [
9+
{
10+
"phase": "build"
11+
}
12+
],
13+
"supplier": {
14+
"name": "Screenly, Inc",
15+
"url": "https://www.screenly.io/"
16+
},
17+
"externalReferences": [
18+
{
19+
"type": "documentation",
20+
"url": "https://developer.screenly.io/"
21+
},
22+
{
23+
"type": "vcs",
24+
"url": "https://github.com/${GITHUB_REPOSITORY}.git"
25+
},
26+
{
27+
"type": "support",
28+
"url": "https://support.screenly.io"
29+
}
30+
],
31+
"authors": [
32+
{
33+
"name": "Screenly Dev Team",
34+
"email": "support@screenly.io"
35+
}
36+
],
37+
"licenses": [
38+
{
39+
"license": {
40+
"id": "MIT",
41+
"name": "MIT License",
42+
"url": "https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master/LICENSE"
43+
}
44+
}
45+
],
46+
"component": {
47+
"name": "screenly-cli",
48+
"bom-ref": "screenly-cli-${VERSION}",
49+
"purl": "pkg:github/${GITHUB_REPOSITORY}@${VERSION_TAG}",
50+
"version": "${VERSION}"
51+
}
52+
"externalReferences": [
53+
{
54+
"type": "documentation",
55+
"url": "https://developer.screenly.io/"
56+
},
57+
{
58+
"type": "vcs",
59+
"url": "https://github.com/${GITHUB_REPOSITORY}.git"
60+
},
61+
{
62+
"type": "support",
63+
"url": "https://support.screenly.io"
64+
}
65+
]
66+
}
67+
}

0 commit comments

Comments
 (0)