ci(release): publish Sigstore attestation bundles

Ship per-target and SHA256SUMS .intoto.jsonl files with the release
so provenance is downloadable for manual and offline checks (#1267).
This commit is contained in:
mohammad junayd 2026-09-14 17:22:07 +04:00
parent 3b870c8fbb
commit 8d09cff912

View file

@ -98,8 +98,11 @@ jobs:
# Sigstore keyless provenance (GitHub OIDC). Attest the published archive
# and wheel on the runner that built them so the installer can pin
# usestrix/strix/.github/workflows/build-release.yml.
# usestrix/strix/.github/workflows/build-release.yml. The bundle is also
# copied into dist/release/ so it ships as a release asset for manual /
# offline verification (#1267).
- name: Attest Unix archive and wheel
id: attest-unix
if: runner.os != 'Windows'
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
@ -108,6 +111,7 @@ jobs:
dist/*.whl
- name: Attest Windows archive and wheel
id: attest-windows
if: runner.os == 'Windows'
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
@ -115,12 +119,23 @@ jobs:
dist/release/*.zip
dist/*.whl
- name: Publish attestation bundle
shell: bash
env:
# Only one of the attest steps runs; the other output is empty.
BUNDLE_PATH: ${{ steps.attest-unix.outputs.bundle-path }}${{ steps.attest-windows.outputs.bundle-path }}
run: |
test -n "$BUNDLE_PATH"
test -f "$BUNDLE_PATH"
cp "$BUNDLE_PATH" "dist/release/strix-${{ matrix.target }}.intoto.jsonl"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: strix-${{ matrix.target }}
path: |
dist/release/*.tar.gz
dist/release/*.zip
dist/release/*.intoto.jsonl
dist/*.whl
if-no-files-found: error
@ -138,11 +153,9 @@ jobs:
path: release
merge-multiple: true
# Same-origin integrity manifest for every release asset. Hashes use bare
# basenames (no directory prefix) so the installer can match the file it
# downloaded into a temp dir. Detects corruption / single-asset swap.
# Sigstore provenance on the archive itself is what binds the bytes to
# this workflow (#1267).
# Same-origin integrity manifest for product assets (archives + wheels).
# Provenance bundles are published alongside the release but excluded here
# so SHA256SUMS stays a stable product-byte list the installer greps.
- name: Generate SHA256SUMS
working-directory: release
shell: bash
@ -150,19 +163,29 @@ jobs:
: > SHA256SUMS
while IFS= read -r -d '' f; do
( cd "$(dirname "$f")" && sha256sum "$(basename "$f")" )
done < <(find . -type f ! -name SHA256SUMS -print0 | sort -z) >> SHA256SUMS
done < <(find . -type f ! -name SHA256SUMS ! -name '*.intoto.jsonl' -print0 | sort -z) >> SHA256SUMS
echo "=== SHA256SUMS ==="
cat SHA256SUMS
- name: Attest SHA256SUMS
id: attest-sums
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-path: release/SHA256SUMS
- name: Publish SHA256SUMS attestation bundle
shell: bash
env:
BUNDLE_PATH: ${{ steps.attest-sums.outputs.bundle-path }}
run: |
test -n "$BUNDLE_PATH"
test -f "$BUNDLE_PATH"
cp "$BUNDLE_PATH" release/SHA256SUMS.intoto.jsonl
- name: Create Release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
with:
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
generate_release_notes: true
# release/** already includes release/SHA256SUMS generated above.
# Includes SHA256SUMS and *.intoto.jsonl provenance bundles.
files: release/**