Skip to content

Commit 6ff98dc

Browse files
feat: add SBOM generation and release workflow
feat: add SBOM generation and release workflow
2 parents 602d84e + 3272da3 commit 6ff98dc

File tree

5 files changed

+352
-13
lines changed

5 files changed

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

.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)