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
63 changes: 62 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
build:
name: build sdist and wheel
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
Expand All @@ -20,10 +24,27 @@ jobs:
run: |
python -m pip install --require-hashes -r requirements/release.txt
python -m build --no-isolation
- name: Attest build provenance
id: attest
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: dist/*
- name: Name provenance bundle
env:
BUNDLE: ${{ steps.attest.outputs.bundle-path }}
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
mkdir provenance
jq -c . "$BUNDLE" > "provenance/oak_events-${version}.intoto.jsonl"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dist
path: dist/
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: provenance
path: provenance/

publish:
name: publish to PyPI
Expand All @@ -37,4 +58,44 @@ jobs:
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1

github-release:
name: GitHub release with provenance
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: dist
path: dist/
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: provenance
path: provenance/
- name: Verify provenance and create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
bundle="provenance/oak_events-${version}.intoto.jsonl"
for f in dist/*; do
gh attestation verify "$f" \
--bundle "$bundle" \
--repo "$GITHUB_REPOSITORY" \
--signer-workflow "${GITHUB_REPOSITORY}/.github/workflows/release.yml"
done
awk -v head="## [${version}]" 'index($0, head) == 1 {p = 1; next} p && /^## / {exit} p' CHANGELOG.md > notes.md
test -s notes.md || echo "See CHANGELOG.md." > notes.md
gh release create "$GITHUB_REF_NAME" \
--repo "$GITHUB_REPOSITORY" \
--verify-tag \
--title "oak-events ${version}" \
--notes-file notes.md \
dist/* "$bundle"
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ All notable changes to this project are documented here. The format follows

## [Unreleased]

### Added

- Signed releases: the `release` workflow records a GitHub artifact
attestation (Sigstore-signed SLSA build provenance) for the sdist and
wheel in the job that builds them, and after the PyPI upload creates a
GitHub Release with both files and the provenance bundle
`oak_events-<version>.intoto.jsonl`. Verify a download with
`gh attestation verify <file> --repo cloudlabworks/oak-events`. PyPI's own
PEP 740 attestations are unchanged.

## [0.1.2] - 2026-11-02

### Added
Expand Down
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ Anything that breaks the privacy model described in the README, for example:
the events directory, or touching the camera,
- event files being created with permissions broader than the owner.

## Verifying a release

From the release after 0.1.2, each version tag builds the sdist and wheel
once, records build provenance for them through Sigstore, publishes them to
PyPI and attaches the same files and `oak_events-<version>.intoto.jsonl` to
the GitHub Release. To check a downloaded file:

```bash
gh attestation verify oak_events-<version>-py3-none-any.whl --repo cloudlabworks/oak-events
```

Add `--bundle oak_events-<version>.intoto.jsonl` to verify against the bundle
from the release instead of the GitHub attestations API. PyPI also serves PEP
740 publish attestations for every file it hosts.

## Supported versions

Only the latest release receives fixes while the project is pre-1.0.
Loading