Skip to content

Commit 5bd0169

Browse files
KSXGitHubclaude
andauthored
ci(deploy): provenance (#387)
Use actions/attest-build-provenance to generate Sigstore-backed attestations for each released executable, so consumers can verify that the binaries on GitHub Releases were built by this workflow rather than uploaded manually. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5d4b5bd commit 5bd0169

2 files changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ jobs:
6464

6565
runs-on: ubuntu-latest
6666

67+
permissions:
68+
contents: read
69+
id-token: write # needed for actions/attest-build-provenance
70+
attestations: write
71+
6772
strategy:
6873
fail-fast: true
6974
matrix:
@@ -90,6 +95,11 @@ jobs:
9095
- name: Strip all debug symbols
9196
run: strip --strip-all target/${{ matrix.target }}/release/pdu
9297

98+
- name: Attest build provenance
99+
uses: actions/attest-build-provenance@v2
100+
with:
101+
subject-path: target/${{ matrix.target }}/release/pdu
102+
93103
- name: Upload build artifact
94104
uses: actions/upload-artifact@v7
95105
with:
@@ -101,6 +111,11 @@ jobs:
101111

102112
runs-on: macos-latest
103113

114+
permissions:
115+
contents: read
116+
id-token: write # needed for actions/attest-build-provenance
117+
attestations: write
118+
104119
strategy:
105120
fail-fast: true
106121
matrix:
@@ -126,6 +141,11 @@ jobs:
126141
- name: Strip all debug symbols
127142
run: strip target/${{ matrix.target }}/release/pdu
128143

144+
- name: Attest build provenance
145+
uses: actions/attest-build-provenance@v2
146+
with:
147+
subject-path: target/${{ matrix.target }}/release/pdu
148+
129149
- name: Upload build artifact
130150
uses: actions/upload-artifact@v7
131151
with:
@@ -137,6 +157,11 @@ jobs:
137157

138158
runs-on: windows-latest
139159

160+
permissions:
161+
contents: read
162+
id-token: write # needed for actions/attest-build-provenance
163+
attestations: write
164+
140165
strategy:
141166
fail-fast: true
142167
matrix:
@@ -161,6 +186,11 @@ jobs:
161186
- name: Build
162187
run: cargo build --target ${{ matrix.target }} --release --all-features
163188

189+
- name: Attest build provenance
190+
uses: actions/attest-build-provenance@v2
191+
with:
192+
subject-path: target/${{ matrix.target }}/release/pdu.exe
193+
164194
- name: Upload build artifact
165195
uses: actions/upload-artifact@v7
166196
with:
@@ -218,9 +248,25 @@ jobs:
218248

219249
runs-on: ubuntu-latest
220250

251+
permissions:
252+
contents: write
253+
id-token: write # needed for actions/attest-build-provenance
254+
attestations: write
255+
221256
steps:
222257
- uses: actions/checkout@v6
223258

259+
- name: Attest build provenance
260+
uses: actions/attest-build-provenance@v2
261+
with:
262+
subject-path: |
263+
./exports/completion.bash
264+
./exports/completion.fish
265+
./exports/completion.zsh
266+
./exports/completion.ps1
267+
./exports/completion.elv
268+
./exports/pdu.1
269+
224270
- name: Upload Tab-Completion file for Bash
225271
uses: actions/upload-release-asset@v1.0.2
226272
env:
@@ -349,6 +395,11 @@ jobs:
349395

350396
runs-on: ubuntu-latest
351397

398+
permissions:
399+
contents: write
400+
id-token: write # needed for actions/attest-build-provenance
401+
attestations: write
402+
352403
steps:
353404
- uses: actions/checkout@v6
354405

@@ -363,6 +414,14 @@ jobs:
363414
- name: Create checksums
364415
run: ./ci/github-actions/create-checksums.sh
365416

417+
- name: Attest build provenance
418+
uses: actions/attest-build-provenance@v2
419+
with:
420+
subject-path: |
421+
./sha1sum.txt
422+
./sha256sum.txt
423+
./sha512sum.txt
424+
366425
- name: Upload as artifacts
367426
uses: actions/upload-artifact@v7
368427
with:

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ Beware that the structure of the JSON tree differs depending on the number of fi
146146

147147
Go to the [GitHub Release Page](https://github.com/KSXGitHub/parallel-disk-usage/releases) and download a binary.
148148

149+
> [!NOTE]
150+
> Starting with version 0.22.1, every executable published to GitHub Releases ships with a build provenance attestation, so you can cryptographically verify that the binary was produced by this repository's deployment workflow rather than uploaded by hand. See [_How can I trust the release binaries?_](#how-can-i-trust-the-release-binaries) for the verification command.
151+
149152
#### From [crates.io](https://crates.io)
150153

151154
**Prerequisites:**
@@ -183,6 +186,21 @@ No. "Vibe coding" means letting AI do everything without human involvement. This
183186

184187
Using AI also does not mean poor quality. On the contrary, AI reviews have helped detect previously undetected bugs.
185188

189+
### How can I trust the release binaries?
190+
191+
Starting with version 0.22.1, every executable published to [GitHub Releases](https://github.com/KSXGitHub/parallel-disk-usage/releases) is accompanied by a [build provenance attestation](https://docs.github.com/en/actions/how-tos/secure-your-work/use-artifact-attestations/use-artifact-attestations). The attestation is cryptographically signed by [Sigstore](https://www.sigstore.dev/) — a public-good signing service operated by the Linux Foundation — and records that the binary was built by this repository's GitHub Actions deployment workflow from a specific commit. Because the signing happens inside GitHub's infrastructure via OIDC and the signatures are logged to Sigstore's public transparency log, the guarantee does not depend on trusting the maintainer's personal word: any tampered or manually uploaded binary would fail verification.
192+
193+
To verify a downloaded binary, install the [GitHub CLI](https://cli.github.com/) and run:
194+
195+
```sh
196+
gh attestation verify downloaded-pdu --repo KSXGitHub/parallel-disk-usage
197+
# note: replace `downloaded-pdu` with the filename you downloaded.
198+
```
199+
200+
A successful run prints the signer workflow and confirms that the file's SHA-256 matches the attested digest. All attestations for this repository can also be browsed at the [Attestations page](https://github.com/KSXGitHub/parallel-disk-usage/attestations).
201+
202+
Binaries from releases older than 0.22.1 are not attested.
203+
186204
## Similar programs
187205

188206
* **CLI:**

0 commit comments

Comments
 (0)