Skip to content

Commit f6540f5

Browse files
authored
Add SBOM to publish.yml (#25)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
1 parent 760048f commit f6540f5

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,32 @@ jobs:
9292
path: dist/
9393
- uses: pypa/gh-action-pypi-publish@release/v1
9494

95+
sbom:
96+
needs: [check, build, publish]
97+
if: needs.check.outputs.increment == 'True'
98+
runs-on: ubuntu-latest
99+
permissions:
100+
contents: write
101+
steps:
102+
- uses: actions/checkout@v5
103+
- uses: actions/setup-python@v5
104+
with:
105+
python-version: "3.x"
106+
- uses: astral-sh/setup-uv@v6
107+
- run: |
108+
uv venv sbom-env
109+
uv pip install -e .
110+
env:
111+
VIRTUAL_ENV: sbom-env
112+
- uses: anchore/sbom-action@v0
113+
with:
114+
format: spdx-json
115+
output-file: sbom.spdx.json
116+
path: sbom-env
117+
- run: gh release upload ${{ needs.check.outputs.current_tag }} sbom.spdx.json
118+
env:
119+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
95121
notify:
96122
needs: [check, publish]
97123
if: always() && needs.check.outputs.increment == 'True'
@@ -104,7 +130,7 @@ jobs:
104130
run: |
105131
PR_JSON=$(gh pr list --search "${GITHUB_SHA}" --state merged --json number,title --jq '.[0]')
106132
PR_NUMBER=$(echo "${PR_JSON}" | jq -r '.number')
107-
PR_TITLE=$(echo "${PR_JSON}" | jq -r '.title')
133+
PR_TITLE=$(echo "${PR_JSON}" | jq -r '.title' | sed 's/"/\\"/g')
108134
echo "PR_NUMBER=${PR_NUMBER}" >> "${GITHUB_ENV}"
109135
echo "PR_TITLE=${PR_TITLE}" >> "${GITHUB_ENV}"
110136
- name: Notify Success

autoimport/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from autoimport.main import LazyLoader, lazy
44

55
__all__ = ("LazyLoader", "lazy")
6-
__version__ = "0.0.3"
6+
__version__ = "0.0.4"

0 commit comments

Comments
 (0)