Skip to content

Commit 96eab1d

Browse files
authored
ci(release): attest GitHub Release assets with build provenance (#7467)
Adds a build provenance attestation for every GitHub Release asset, created in the `publish` job right before the release is made immutable. - `actions/attest` signs the versioned tarballs, zips, deb/rpm/apk packages, `checksums.txt` and the `install` script. The unversioned `supabase_<os>_<arch>.tar.gz` aliases are byte-identical copies, so the same attestations cover them by digest. - `attestations: write` is granted to the `publish` job and to both callers of `release-shared.yml` (`release.yml` and `release-smoke-test.yml`), since a reusable workflow cannot exceed its caller's permissions. Anyone can now verify a downloaded asset with `gh attestation verify <file> --repo supabase/cli`. Once a release ships with attestations, the aqua registry entry for `supabase/cli` can add `github_artifact_attestations` with `signer_workflow: supabase/cli/.github/workflows/release-shared.yml`, which makes mise and aqua verify each download against it. This touches release infrastructure, so it needs a cherry-pick to `v2.x`.
1 parent 497bf42 commit 96eab1d

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎.github/workflows/release-shared.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ jobs:
283283
LINEAR_CLI_STABLE_RELEASE_ACCESS_KEY: ${{ secrets.LINEAR_CLI_STABLE_RELEASE_ACCESS_KEY }}
284284
LINEAR_CLI_BETA_RELEASE_ACCESS_KEY: ${{ secrets.LINEAR_CLI_BETA_RELEASE_ACCESS_KEY }}
285285
permissions:
286+
attestations: write
286287
contents: write
287288
id-token: write
288289
steps:
@@ -409,6 +410,16 @@ jobs:
409410
GH_TOKEN: ${{ github.token }}
410411
run: bun apps/cli/scripts/upload-release-assets.ts verify --version "${VERSION}"
411412

413+
# Lets installers such as aqua and mise verify each asset with `gh attestation verify`; the
414+
# unversioned tarball aliases share their versioned twin's digest, so they are covered too.
415+
- name: Attest release assets
416+
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
417+
with:
418+
subject-path: |
419+
dist/supabase_${{ inputs.version }}_*
420+
dist/checksums.txt
421+
install
422+
412423
- name: Publish GitHub Release (immutable)
413424
env:
414425
GH_TOKEN: ${{ github.token }}

‎.github/workflows/release-smoke-test.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
# dry_run here, but GitHub validates nested-workflow permissions at startup.
3636
permissions:
3737
actions: read
38+
attestations: write
3839
contents: write
3940
id-token: write
4041
pull-requests: write

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ jobs:
341341
# those granted to the calling job, so this must be declared here too.
342342
permissions:
343343
actions: read
344+
attestations: write
344345
contents: write
345346
id-token: write
346347
pull-requests: write

0 commit comments

Comments
 (0)