Skip to content

Commit

Permalink
Generate and upload SBOM (#12)
Browse files Browse the repository at this point in the history
* Generate and upload SBOM

* Split off SBOM generation
  • Loading branch information
dragomirp authored Jun 26, 2023
1 parent 08192e7 commit 77cb443
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/build.yaml
sbom:
uses: ./.github/workflows/sbom.yaml
publish:
needs: build
needs: sbom
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/sbom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generate SBOM
on:
workflow_call:

jobs:
build:
uses: ./.github/workflows/build.yaml
sbom:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Syft
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Set tag
run: |
version=$(yq '(.version|split("-"))[0]' rockcraft.yaml)
base=$(yq '(.base|split(":"))[1]' rockcraft.yaml)
echo "tag=${version}-${base}_edge" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v3
with:
name: postgresql-rock
- name: Create SBOM
run: syft charmed-postgresql_${{env.tag}}_amd64.rock -o spdx-json=charmed-postgresql_${{env.tag}}_amd64.rock.spdx.json
- name: Upload SBOM
uses: actions/upload-artifact@v3
with:
path: "charmed-postgresql_${{env.tag}}_amd64.rock.spdx.json"
name: charmed-postgresql_${{env.tag}}_amd64.rock.spdx.json

0 comments on commit 77cb443

Please sign in to comment.