Skip to content

Commit

Permalink
Generate sbom (#156)
Browse files Browse the repository at this point in the history
* Generate sbom

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Jul 12, 2024
1 parent 7d6d454 commit 3e39ed5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Python matrix CI

on:
push:
paths-ignore:
- '**/README.md'
pull_request:
workflow_dispatch:

jobs:
build:
Expand All @@ -23,6 +21,15 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -36,3 +43,7 @@ jobs:
env:
PYTHONPATH: .
TEST_VDB_HOME: vdb_data
- name: Generate SBOM with cdxgen
run: |
npm install -g @cyclonedx/cdxgen
cdxgen -t python -o bom.json . -p
31 changes: 23 additions & 8 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,36 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
python3 -m build
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1

- name: Generate SBOM with cdxgen
run: |
npm install -g @cyclonedx/cdxgen
cdxgen -t python -o bom.json .
- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
bom.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3e39ed5

Please sign in to comment.