Skip to content

Commit bca85ae

Browse files
ci: fix publish — move SBOM out of dist/, fix attach-sbom repo context
Two fixes: 1. SBOM was generated into dist/ causing PyPI publisher to reject it as 'Unknown distribution format'. Now generated to sbom/ and uploaded as a separate artifact. 2. attach-sbom job had no git checkout so `gh release upload` failed with 'not a git repository'. Added --repo flag instead.
1 parent 6228e48 commit bca85ae

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ jobs:
157157
steps:
158158
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
159159
with:
160-
name: dist
161-
path: dist/
160+
name: sbom
161+
path: sbom/
162162
- name: Upload SBOM to GitHub Release
163163
env:
164164
GH_TOKEN: ${{ github.token }}
165165
run: |
166-
if [ -f dist/aiir-sbom.cdx.json ]; then
167-
gh release upload "$GITHUB_REF_NAME" dist/aiir-sbom.cdx.json \
168-
--clobber
166+
if [ -f sbom/aiir-sbom.cdx.json ]; then
167+
gh release upload "$GITHUB_REF_NAME" sbom/aiir-sbom.cdx.json \
168+
--clobber --repo "${{ github.repository }}"
169169
echo "✅ SBOM attached to release $GITHUB_REF_NAME"
170170
else
171171
echo "::warning::SBOM file not found — skipping"
@@ -192,14 +192,19 @@ jobs:
192192
# declared dependencies (which is zero for aiir, but proves it).
193193
# NOTE: --schema-version was removed in cyclonedx-bom v7; the tool
194194
# now emits the latest CycloneDX schema version automatically.
195+
mkdir -p sbom
195196
cyclonedx-py environment \
196197
--output-format json \
197-
--output-file dist/aiir-sbom.cdx.json
198-
echo "✅ SBOM generated: $(wc -c < dist/aiir-sbom.cdx.json) bytes"
198+
--output-file sbom/aiir-sbom.cdx.json
199+
echo "✅ SBOM generated: $(wc -c < sbom/aiir-sbom.cdx.json) bytes"
199200
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
200201
with:
201202
name: dist
202203
path: dist/
204+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
205+
with:
206+
name: sbom
207+
path: sbom/
203208

204209
# ── Step 3: Publish to PyPI ────────────────────────────────────────
205210
publish:

0 commit comments

Comments
 (0)