Skip to content

Commit dc27b33

Browse files
authored
ci: use goreleaser native provenance (#751)
1 parent 10beb4b commit dc27b33

4 files changed

Lines changed: 13 additions & 57 deletions

File tree

.ci/get-docker-provenance.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,12 @@ jobs:
7575
- name: generate build provenance (binaries)
7676
uses: actions/attest-build-provenance@v3
7777
with:
78-
subject-path: "${{ github.workspace }}/dist/*.*"
78+
subject-checksums: ./dist/checksums.txt
7979

80-
# See https://github.com/github-early-access/generate-build-provenance/issues/162
81-
- name: container image digest
82-
id: image
83-
run: .ci/get-docker-provenance.sh
84-
85-
- name: generate build provenance (containers x86_64)
86-
uses: actions/attest-build-provenance@v3
87-
with:
88-
subject-name: ${{ steps.image.outputs.name_1 }}
89-
subject-digest: ${{ steps.image.outputs.digest_1 }}
90-
91-
- name: generate build provenance (containers arm64)
80+
- name: generate build provenance (docker images)
9281
uses: actions/attest-build-provenance@v3
9382
with:
94-
subject-name: ${{ steps.image.outputs.name_2 }}
95-
subject-digest: ${{ steps.image.outputs.digest_2 }}
83+
subject-checksums: ./dist/digests.txt
9684

9785
- name: GitHub Release
9886
run: make release-notes

.github/workflows/test.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,13 @@ jobs:
6565
path: "dist/*.*"
6666
retention-days: 5
6767

68+
# NOTE: snapshots won't push docker images hence we cannot run provenance on a PR basis
69+
# but only for binaries
6870
- name: generate build provenance (binaries)
6971
if: github.event.pull_request.head.repo.full_name == github.repository
7072
uses: actions/attest-build-provenance@v3
7173
with:
72-
subject-path: "${{ github.workspace }}/dist/*.*"
73-
74-
# See https://github.com/github-early-access/generate-build-provenance/issues/162
75-
- name: container image digest
76-
id: image
77-
run: .ci/get-docker-provenance.sh
78-
79-
- name: generate build provenance (containers x86_64)
80-
if: github.event.pull_request.head.repo.full_name == github.repository
81-
uses: actions/attest-build-provenance@v3
82-
with:
83-
subject-name: ${{ steps.image.outputs.name_1 }}
84-
subject-digest: ${{ steps.image.outputs.digest_1 }}
85-
86-
- name: generate build provenance (containers arm64)
87-
if: github.event.pull_request.head.repo.full_name == github.repository
88-
uses: actions/attest-build-provenance@v3
89-
with:
90-
subject-name: ${{ steps.image.outputs.name_2 }}
91-
subject-digest: ${{ steps.image.outputs.digest_2 }}
74+
subject-checksums: ./dist/checksums.txt
9275

9376
lint:
9477
runs-on: ubuntu-latest

.goreleaser.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,10 @@ sboms:
102102
- artifacts: archive
103103
documents:
104104
- "{{ .ArtifactName }}.sbom.json"
105+
106+
# Configure the checksums filename, to allow the GitHub attestation to pick up the correct filename
107+
checksum:
108+
name_template: checksums.txt
109+
110+
docker_digest:
111+
name_template: "digests.txt"

0 commit comments

Comments
 (0)