Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,34 @@ on:
permissions: {}

jobs:
generate-sbom:
name: Generate SBOM
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: false
- name: Generate SBOM
run: |
uv sync --locked --no-dev
uvx --from cyclonedx-bom==7.3.0 cyclonedx-py environment --output-format json -o sbom.cdx.json
- name: Upload SBOM
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom
path: sbom.cdx.json

build:
name: Build distribution
runs-on: ubuntu-latest
needs: generate-sbom
permissions:
contents: read

Expand All @@ -22,6 +47,10 @@ jobs:
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: false
- name: Download generated SBOM
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: sbom
- name: Build a binary wheel and a source tarball
run: uv build
- name: Store the distribution packages
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling>=1.28.0"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/tinfoil"]
sbom-files = ["sbom.cdx.json"]
Comment thread
milesdai marked this conversation as resolved.

[project]
name = "tinfoil"
Expand Down
15 changes: 15 additions & 0 deletions sbom.cdx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"version": 1,
"metadata": {
"properties": [
{
"name": "placeholder",
"value": "This is a placeholder file to satisfy the hatchling build backend. The real SBOM is populated in the release flow."
}
]
},
"components": []
}