From 17c5652e868ec3bf8eb3a30e8725cb8f9fbe7481 Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Mon, 18 Oct 2021 02:15:16 +0200 Subject: [PATCH 1/2] chore(release): run goreleaser only if tag pushed --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ae5658..6e38a42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 + if: startsWith(github.ref, 'refs/tags/') with: version: v0.182.1 args: release --rm-dist From 0c94b7a1bea155c684ab909161b50b7d4bca451d Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Tue, 19 Oct 2021 00:52:40 +0200 Subject: [PATCH 2/2] fix(release): publish binary, revert name change. Publish the binary directly instead of publishing an archive. --- .goreleaser.yml | 15 +++++++++------ README.md | 12 ++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 51ed12c..7356935 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -6,14 +6,17 @@ before: builds: - main: ./cmd/khelm targets: - - linux_amd64 - - linux_arm64 - - darwin_amd64 - - darwin_arm64 + - linux_amd64 + - linux_arm64 + - darwin_amd64 + - darwin_arm64 env: - - CGO_ENABLED=0 + - CGO_ENABLED=0 ldflags: - - -s -w -extldflags '-static' -X main.khelmVersion={{.Version}} -X main.helmVersion={{.Env.HELM_VERSION}} + - -s -w -extldflags '-static' -X main.khelmVersion={{.Version}} -X main.helmVersion={{.Env.HELM_VERSION}} +archives: +- format: binary + name_template: "{{.ProjectName}}-{{.Os}}-{{.Arch}}" checksum: name_template: 'checksums.txt' snapshot: diff --git a/README.md b/README.md index c810280..e1f2afd 100644 --- a/README.md +++ b/README.md @@ -101,11 +101,13 @@ Though plugin support in kustomize is still an alpha feature and may be removed #### Plugin installation -Install using curl (linux amd64): +Install using curl (on OSX or Linux): ```sh +OS=$(uname | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/') mkdir -p $HOME/.config/kustomize/plugin/khelm.mgoltzsche.github.com/v1/chartrenderer -curl -fsSL https://github.com/mgoltzsche/khelm/releases/latest/download/khelm-linux-amd64 > $HOME/.config/kustomize/plugin/khelm.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer -chmod u+x $HOME/.config/kustomize/plugin/khelm.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer +curl -fsSL https://github.com/mgoltzsche/khelm/releases/latest/download/khelm-${OS}-${ARCH} > $HOME/.config/kustomize/plugin/khelm.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer +chmod +x $HOME/.config/kustomize/plugin/khelm.mgoltzsche.github.com/v1/chartrenderer/ChartRenderer ``` or using `go`: ```sh @@ -145,7 +147,9 @@ khelm also supports a helm-like `template` CLI. #### Binary installation ```sh -curl -fsSL https://github.com/mgoltzsche/khelm/releases/latest/download/khelm-linux-amd64 > khelm +OS=$(uname | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/') +curl -fsSL https://github.com/mgoltzsche/khelm/releases/latest/download/khelm-${OS}-${ARCH} > khelm chmod +x khelm sudo mv khelm /usr/local/bin/khelm ```