Skip to content

fix: bundle install scripts in release archives (#504)#1011

Open
yxxhero wants to merge 4 commits into
masterfrom
fix-504-archive-install-scripts
Open

fix: bundle install scripts in release archives (#504)#1011
yxxhero wants to merge 4 commits into
masterfrom
fix-504-archive-install-scripts

Conversation

@yxxhero

@yxxhero yxxhero commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Problem

Extracting a release .tgz (e.g. helm-diff-linux-amd64.tgz) and running helm plugin install ./diff fails:

sh: 1: .../diff/install-binary.sh: not found
Error: plugin install hook for "diff" exited with error

The goreleaser-built archives only shipped plugin.yaml, the binary, README.md and LICENSE, but plugin.yaml defines install/update hooks referencing install-binary.sh / install-binary.ps1, which were not bundled.

Fixes #504

Changes

  • .goreleaser.yml — bundle install-binary.sh and install-binary.ps1 in every archive.
  • install-binary.sh / install-binary.ps1 — skip the redundant binary download when the platform binary is already staged in HELM_PLUGIN_DIR during install (the archive already bundles the correct binary). Update mode (-u) always re-downloads.
  • .github/workflows/release.yaml — snapshot-only smoke test that fails if any archive is missing plugin.yaml, the install scripts, or the binary.
  • README.md — document that helm plugin install ./diff now works directly from an extracted release .tgz.

How install flows behave

Flow Before After
helm plugin install https://github.com/databus23/helm-diff (git clone) works (downloads binary) unchanged
helm plugin install ./diff from extracted release .tgz fails (script missing) works, skips download (offline)
helm plugin update (-u) works (re-downloads) unchanged

Verification

  • shellcheck install-binary.sh — clean
  • Local simulation harness (3 scenarios): archive-install skip, git-clone download path, and -u no-skip — all pass
  • CI adds a snapshot smoke test asserting archive contents

Notes

yxxhero added 4 commits June 15, 2026 08:32
Release .tgz archives built by goreleaser only shipped plugin.yaml, the
binary, README and LICENSE, but plugin.yaml defines install/update hooks
that call install-binary.sh / install-binary.ps1. Extracting a release
.tgz and running 'helm plugin install ./diff' therefore failed with
'install-binary.sh: not found'.

- .goreleaser.yml: bundle install-binary.sh and install-binary.ps1 in
  every archive.
- install-binary.sh / install-binary.ps1: skip the (now redundant)
  binary download when the platform binary is already staged in
  HELM_PLUGIN_DIR during install. Update mode always re-downloads.
- release workflow: snapshot-only smoke test asserting every archive
  bundles plugin.yaml, both install scripts, and the binary.
- README: note that extracting a release .tgz and running
  helm plugin install ./diff now works directly.

Fixes #504

Signed-off-by: yxxhero <aiopsclub@163.com>
Windows archives bundle diff/bin/diff.exe (not diff/bin/diff). The core
fix is confirmed working: all archives (incl. Windows) now bundle the
install scripts and binary.

Signed-off-by: yxxhero <aiopsclub@163.com>
The git-clone install path resolves to releases/latest/download/<asset>,
which can 404 during a release window when the new release is published
but its assets are not fully uploaded yet. curl -sSf under 'set -e'
failed immediately with no retry.

Add a 5-attempt retry loop with linear backoff (3s,6s,9s,12s) around the
curl/wget download in install-binary.sh, and equivalent try/catch retry
in install-binary.ps1. This absorbs the release upload window and
general transient network errors. The archive-install path is unaffected
(it skips the download entirely via the existing guard).

Signed-off-by: yxxhero <aiopsclub@163.com>
Reproduces the issue #504 scenario in CI: extracts a snapshot linux
archive, runs 'helm plugin install ./diff', asserts the install hook
skips the network download (bundled binary already staged) and that
'helm diff version' runs. Prevents regressions in the archive-install
path.

Signed-off-by: yxxhero <aiopsclub@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After downloading the .tgz release files, helm plugin install is failing

1 participant