diff --git a/plugin.yaml b/plugin.yaml index 5aa47cc..02fa0d8 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -13,12 +13,18 @@ # limitations under the License. Name: "release" -version: "0.3.0" +version: "0.3.1" usage: "pull or update Helm Releases" description: |- Update values of a releases, pull charts from releases command: "$HELM_PLUGIN_DIR/release.sh" hooks: - install: | - wget https://github.com/mikefarah/yq/releases/download/v4.25.3/yq_linux_amd64 -O $HELM_PLUGIN_DIR/lib/yq; - chmod +x $HELM_PLUGIN_DIR/lib/yq; \ No newline at end of file + install: | + VERSION=$(curl --silent "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r .tag_name) + case "$OSTYPE" in + darwin*) BINARY="yq_darwin_amd64" ;; + linux*) BINARY="yq_linux_amd64" ;; + *) printf '%s\n' "Unsupported operating system detected while installing yq." >&2;exit 1 ;; + esac + curl -L https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -o $HELM_PLUGIN_DIR/lib/yq; + chmod +x $HELM_PLUGIN_DIR/lib/yq;