Publish Helm plugin provenance artifacts in release pipeline#1006
Publish Helm plugin provenance artifacts in release pipeline#1006Copilot wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the release pipeline to publish Helm v4-compatible provenance (.prov) artifacts for the plugin archives so Helm installs can succeed with default verification enabled.
Changes:
- Added a GoReleaser signing step to generate clear-signed
${archive}.provprovenance files for each published.tgz. - Updated the GitHub Actions release workflow to import the GPG key on tag releases and skip signing for snapshot runs.
- Updated README guidance to remove the Helm 4
--verify=falseworkaround and describe provenance availability.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Updates Helm 4 installation guidance to reflect published provenance artifacts. |
| .goreleaser.yml | Adds signing logic to generate Helm-compatible .prov files for archive artifacts. |
| .github/workflows/release.yaml | Wires GPG key import/secrets and adjusts snapshot flags to skip signing. |
| { | ||
| cat plugin.yaml | ||
| printf '\n...\n' | ||
| printf 'files:\n %s: "sha256:%s"\n' "$filename" "$digest" | ||
| } | gpg --batch --yes --armor --pinentry-mode loopback --passphrase "${GPG_PASSPHRASE:-}" --local-user "$GPG_FINGERPRINT" --clearsign --output "$signature" |
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} | ||
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
|
@copilot fix ci isssue and comments. |
Fixed both issues in commit
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
README.md:50
- The linked HIP at
hips/hip-0026.mdis titled "H4HIP: Wasm plugin system", not plugin provenance. The link target may be correct, but the link text is currently inaccurate/misleading for readers looking for provenance documentation.
Helm 4 verifies plugin provenance by default. This project publishes release provenance artifacts (`.prov`) alongside release tarballs to support verification.
For more information about Helm 4's plugin verification, see:
- [Helm 4 Overview](https://helm.sh/docs/overview)
- [HIP-0026: Plugin Provenance](https://github.com/helm/community/blob/main/hips/hip-0026.md)
| chmod 600 "$passphrase_file" | ||
| { | ||
| cat plugin.yaml | ||
| printf '\n...\n' |
- Add gpgconf --launch gpg-agent before GPG key import in CI - Fix provenance separator format to match Helm parser (\n...\n -> ...\n) - Add provenance-smoke-test job that validates signing with disposable key - Add workflow_dispatch trigger for manual testing - Document required GPG secrets and key rotation in workflow header - Update README with public key import guidance for Helm 4 users Signed-off-by: yxxhero <aiopsclub@163.com>
| ```shell | ||
| helm plugin install https://github.com/databus23/helm-diff --verify=false | ||
| ``` | ||
| Helm 4 verifies plugin provenance by default. This project publishes GPG-signed provenance artifacts (`.prov`) alongside release tarballs. To verify, import the project's public key into your keyring before running `helm plugin install`. |
| artifact="$1" | ||
| signature="$2" | ||
| filename="$(basename "$artifact")" | ||
| digest="$(sha256sum "$artifact" | cut -d' ' -f1)" |
| # - To rotate: generate a new keypair, update all three secrets, and verify | ||
| # with a test release (see the test-provenance-sign-dry job) |
| filename="$(basename "$artifact")" | ||
| digest="$(sha256sum "$artifact" | cut -d' ' -f1)" | ||
| passphrase_file="$(mktemp)" | ||
| trap 'rm -f "$passphrase_file"' EXIT |
- Add GPG_FINGERPRINT guard with clear error message - Add public key download instructions and fingerprint note to README - Fix header comment referencing provenance-smoke-test job name - Fix double trap overwriting GNUPGHOME cleanup in smoke test - Consolidate cleanup into single trap statement Signed-off-by: yxxhero <aiopsclub@163.com>
| { | ||
| cat plugin.yaml | ||
| printf '...\n' | ||
| printf 'files:\n %s: "sha256:%s"\n' "$filename" "$digest" | ||
| } | gpg --batch --yes --armor --pinentry-mode loopback --passphrase-file "$passphrase_file" --local-user "$GPG_FINGERPRINT" --clearsign --output "$signature" |
| gpgconf --launch gpg-agent | ||
| echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --import |
| GPG_FINGERPRINT=$(gpg --batch --passphrase '' --quick-generate-key \ | ||
| "helm-diff-test" ed25519 sign 0 2>&1 \ | ||
| | grep -o '[A-F0-9]\{40\}' | head -1) | ||
| export GPG_FINGERPRINT |
| { | ||
| cat plugin.yaml | ||
| printf '...\n' | ||
| printf 'files:\n %s: "sha256:%s"\n' "$filename" "$digest" | ||
| } | gpg --batch --yes --armor --pinentry-mode loopback \ |
|
|
||
| ```shell | ||
| helm plugin install https://github.com/databus23/helm-diff --verify=false | ||
| gpg --keyserver keys.openpgp.org --recv-keys <KEY_FINGERPRINT> |
- Use printf instead of echo for GPG key import to avoid corruption - Use --with-colons --list-secret-keys for reliable fingerprint extraction - Use HKPS keyserver URL in README for TLS-protected key fetch Signed-off-by: yxxhero <aiopsclub@163.com>
| helm plugin install https://github.com/databus23/helm-diff | ||
| ``` | ||
|
|
||
| The public key fingerprint is published in each GitHub release notes. |
| artifact="$1" | ||
| signature="$2" | ||
| filename="$(basename "$artifact")" | ||
| digest="$(sha256sum "$artifact" | cut -d' ' -f1)" |
| artifact="$tmpdir/helm-diff-linux-amd64.tgz" | ||
| signature="${artifact}.prov" | ||
| filename="$(basename "$artifact")" | ||
| digest="$(sha256sum "$artifact" | cut -d' ' -f1)" | ||
| printf '%s' "${GPG_PASSPHRASE:-}" > "$passphrase_file" | ||
| chmod 600 "$passphrase_file" | ||
| { | ||
| cat plugin.yaml | ||
| printf '...\n' | ||
| printf 'files:\n %s: "sha256:%s"\n' "$filename" "$digest" | ||
| } | gpg --batch --yes --armor --pinentry-mode loopback \ |
Helm v4 verifies plugin provenance by default, but this repo only published
.tgzplugin archives, causing installs to fail unless verification was explicitly disabled. This PR adds signed.provartifacts to releases and updates install guidance accordingly.Changes
Release artifact signing (
.goreleaser.yml)signsblock for archive artifacts.${artifact}.prov.plugin.yamlmetadata +files:<archive>=sha256:<digest>using GPG (clear-signed output Helm can verify).--passphrase-file) instead of CLI arg to avoid/procleakage.GPG_FINGERPRINTguard with clear error message on misconfiguration.Release workflow (
.github/workflows/release.yaml)GPG_FINGERPRINTandGPG_PASSPHRASEare set via a conditional step gated onstartsWith(github.ref, 'refs/tags/v'), so non-tag/snapshot/PR runs never see these secrets.--skip=sign).gpgconf --launch gpg-agentensures the GPG agent is ready before key import.provenance-smoke-testjob that validates the signing script with a disposable GPG key on PR/push runs (no secrets needed).workflow_dispatchtrigger for manual testing.Docs update (
README.md)--verify=falseworkaround instruction.gpg --keyserver keys.openpgp.org --recv-keys <FINGERPRINT>).Prerequisites
Before the first tagged release, configure these repository secrets (Settings > Secrets and variables > Actions):
GPG_PRIVATE_KEY— base64-encoded GPG private keyGPG_FINGERPRINT— Fingerprint of the GPG keyGPG_PASSPHRASE— Passphrase for the GPG private keyCloses
Closes #1005