Skip to content

Commit 2a481f6

Browse files
feat: add SBOM generation and release workflow
- Add GitHub Actions workflow to generate and release SBOM using cyclonedx-py - Integrate SBOM generation into publish workflow
1 parent 602d84e commit 2a481f6

5 files changed

Lines changed: 348 additions & 13 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Generate and Release SBOM
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
generate-and-release-sbom:
8+
name: Generate and Release SBOM
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 2
14+
15+
- name: Extract version from __init__.py
16+
id: version
17+
run: |
18+
VERSION=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' src/askui/__init__.py)
19+
echo "version=$VERSION" >> $GITHUB_OUTPUT
20+
21+
- name: Load secret
22+
uses: 1password/load-secrets-action@v2
23+
with:
24+
export-env: true
25+
env:
26+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SOLUTIONS_ENGINEER_SERVICE_ACCOUNT_TOKEN }}
27+
DT_API_KEY: "op://github-ci-solutions-engineer-team/DependencyTrack-API-KEY/API-KEY"
28+
29+
- uses: pdm-project/setup-pdm@v4
30+
with:
31+
cache: true
32+
- run: pdm install
33+
- run: pdm run generate:SBOM
34+
35+
- name: Upload SBOM to Dependency Track
36+
uses: askui/action-sbom-deploy@main
37+
with:
38+
apiKey: ${{ env.DT_API_KEY }}
39+
projectName: "AskUI-Python-SDK"
40+
projectVersion: '${{ steps.version.outputs.version }}'
41+
baseTags: 'AskUI-Python-SDK,Solutions-Engineer-Team,public_api'
42+
bomFilename: 'bom.json'

.github/workflows/publish.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ jobs:
2020
cache: true
2121
- name: Publish package distributions to PyPI
2222
run: pdm publish
23+
generate-and-release-sbom:
24+
uses: ./.github/workflows/generate_and_release_sbom.yaml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,4 @@ reports/
168168
/askui_chat.db
169169
.cache/
170170

171+
bom.json

0 commit comments

Comments
 (0)