Skip to content

Commit 09104f0

Browse files
authored
Add release provenance artifact generation
1 parent 315ca76 commit 09104f0

3 files changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/release.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
-
2323
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
24-
run: echo "flags=--snapshot" >> $GITHUB_ENV
24+
run: echo "flags=--snapshot --skip=sign" >> $GITHUB_ENV
2525
-
2626
name: Checkout
2727
uses: actions/checkout@v6
@@ -32,6 +32,10 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
go-version-file: 'go.mod'
35+
-
36+
name: Import GPG key
37+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
38+
run: echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --import
3539
-
3640
name: Run GoReleaser
3741
uses: goreleaser/goreleaser-action@v7
@@ -41,3 +45,5 @@ jobs:
4145
args: release --clean ${{ env.flags }}
4246
env:
4347
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
49+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.goreleaser.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,27 @@ archives:
5252
- README.md
5353
- plugin.yaml
5454
- LICENSE
55+
56+
signs:
57+
- id: plugin-provenance
58+
artifacts: archive
59+
signature: "${artifact}.prov"
60+
cmd: sh
61+
args:
62+
- -ec
63+
- |
64+
artifact="$1"
65+
signature="$2"
66+
filename="$(basename "$artifact")"
67+
digest="$(sha256sum "$artifact" | cut -d' ' -f1)"
68+
{
69+
cat plugin.yaml
70+
printf '\n...\n'
71+
printf 'files:\n %s: "sha256:%s"\n' "$filename" "$digest"
72+
} | gpg --batch --yes --armor --pinentry-mode loopback --passphrase "${GPG_PASSPHRASE:-}" --local-user "$GPG_FINGERPRINT" --clearsign --output "$signature"
73+
- --
74+
- ${artifact}
75+
- ${signature}
5576
changelog:
5677
use: github-native
5778

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ The install script will skip the GitHub download and instead install from the `.
4343

4444
**For Helm 4 users:**
4545

46-
Helm 4 requires plugin verification by default. Since this plugin does not yet provide provenance artifacts, you need to use the `--verify=false` flag:
47-
48-
```shell
49-
helm plugin install https://github.com/databus23/helm-diff --verify=false
50-
```
46+
Helm 4 verifies plugin provenance by default. This project publishes release provenance artifacts (`.prov`) alongside release tarballs to support verification.
5147

5248
For more information about Helm 4's plugin verification, see:
5349
- [Helm 4 Overview](https://helm.sh/docs/overview)

0 commit comments

Comments
 (0)