Skip to content

Open-source skills for designing and reviewing software with AI agents

ci: attest runtime release archives

Oliver Newth07df3d62ea76
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4204bd4..0c51c8f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -22,6 +22,8 @@ jobs:
commit: ${{ steps.source.outputs.commit }}
permissions:
contents: read
+ id-token: write
+ attestations: write
steps:
- name: Require default-branch workflow
env:
@@ -50,6 +52,11 @@ jobs:
env:
RELEASE_TAG: ${{ inputs.tag }}
run: python scripts/prepare_release.py --tag "$RELEASE_TAG" --commit "$(git rev-parse HEAD)" --output release
+ - name: Attest runtime archives
+ uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4
+ with:
+ subject-path: release/*.zip
+ create-storage-record: false
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: release-candidate
diff --git a/docs/releases.md b/docs/releases.md
index 90a46fb..1096003 100644
--- a/docs/releases.md
+++ b/docs/releases.md
@@ -19,7 +19,8 @@ paths, and report formats. Do not change published artifacts under the same tag.
tag on the selected main commit. Never move an existing release tag.
4. Run **Prepare draft release** from `main`, supplying that existing tag.
The tagged commit must include the release scripts and pass unit tests.
-5. Review the draft's two runtime ZIPs, `SHA256SUMS`, and source commit. Replace
+5. Review the draft's two runtime ZIPs, `SHA256SUMS`, and source commit.
+ Verify both ZIP attestations as described below. Replace
placeholder notes with changes, compatibility/migration details, and exact
artifact host-verification evidence. Unverified hosts remain unverified.
6. Publish the draft manually only after review. Directory publication is separate.
@@ -37,3 +38,27 @@ The local command checks manifest versions and builds artifacts; it does not
verify Git tag ancestry or run tests. Those checks belong to the workflow.
Exact installed-bundle verification remains tracked in
[#60](https://github.com/google/elephant-goldfish-model/issues/60).
+
+## Verify downloads
+
+Download both ZIPs and `SHA256SUMS` into one directory. With GitHub CLI installed,
+run these commands from that directory:
+
+```sh
+sha256sum -c SHA256SUMS
+for archive in egm-claude-*.zip egm-openai-*.zip; do
+ gh attestation verify "$archive" --repo google/elephant-goldfish-model \
+ --signer-workflow google/elephant-goldfish-model/.github/workflows/release.yml \
+ --source-ref refs/heads/main || exit 1
+done
+```
+
+The workflow signs both ZIP digests and stores provenance in GitHub before
+creating a draft. Signing failure blocks draft creation. Local preparation does
+not create attestations. The build job uses `id-token: write` to request a signing
+certificate and `attestations: write` to store the result. It cannot write releases.
+
+The provenance identifies the workflow run from `main`. The tagged source checked
+out during that run can be a different commit. Check the release notes for that
+source SHA and inspect the workflow run before publication. Attestations do not
+establish host support or prove that the code is safe.
diff --git a/scripts/prepare_release.py b/scripts/prepare_release.py
index b9bcd7b..9a1eafa 100644
--- a/scripts/prepare_release.py
+++ b/scripts/prepare_release.py
@@ -41,6 +41,12 @@ def prepare(root: Path, tag: str, output: Path, commit: str) -> None:
f"# EGM {version}\n\nSource: `{commit}`\nTag: `{tag}`\n\n"
"Runtime archives: Claude and OpenAI. Verify downloads with "
"`sha256sum -c SHA256SUMS`.\n\n"
+ "For CI-built candidates, verify each ZIP with "
+ "`gh attestation verify FILE --repo google/elephant-goldfish-model "
+ "--signer-workflow google/elephant-goldfish-model/.github/workflows/release.yml "
+ "--source-ref refs/heads/main`. "
+ "Provenance identifies the main-branch workflow run; the tagged source "
+ "commit is recorded above. Local builds have no attestation.\n\n"
"## Changes\n\nMaintainer: summarize changes and migration steps before publishing.\n\n"
"## Verification\n\nOffline unit tests and runtime packaging are checked by CI. "
"Live installation, workflow execution, reviewer isolation, directory approval, "