From fb9da93f402a5bce82b14586b1394ee88a0597e1 Mon Sep 17 00:00:00 2001 From: Dominik Giger Date: Mon, 23 Oct 2023 11:54:52 +0200 Subject: [PATCH] Fix goreleaser config. The 'replacements' parameter was removed in goreleaser. The name now has to be built directly in the file-name template. (See: https://github.com/goreleaser/goreleaser/issues/3588#issuecomment-1326457874) --- .goreleaser.yml | 11 ++++++----- build/Makefile.build | 2 +- build/Makefile.deps | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index b470f55a..0a6905c0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -23,7 +23,7 @@ builds: - arm64 ignore: - goos: darwin - goarch: 386 + goarch: "386" ldflags: -s -w -X main.version={{.Env.VERSION }} -X main.commit={{.Commit}} -X main.owner={{.Env.OWNER}} -X main.repo={{.Env.REPO}} -X main.built={{.Env.BUILT}} binary: ecctl archives: @@ -36,15 +36,16 @@ archives: snapshot: name_template: "{{ .Version }}_SNAPSHOT_{{ .ShortCommit }}" nfpms: - - file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + - file_name_template: >- + {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_ + {{- if eq .Arch "amd64" }}64-bit + {{- else if eq .Arch "386" }}32-bit + {{- else }}{{ .Arch }}{{ end }} license: Apache 2.0 maintainer: Elastic Cloud vendor: Elastic description: ecctl is the CLI for the Elasticsearch Service and Elastic Cloud Enterprise APIs. homepage: https://www.elastic.co/guide/en/ecctl/current/index.html - replacements: - amd64: 64-bit - "386": 32-bit formats: - deb - rpm diff --git a/build/Makefile.build b/build/Makefile.build index d4adaf87..4e4795fb 100644 --- a/build/Makefile.build +++ b/build/Makefile.build @@ -47,7 +47,7 @@ ifneq ($(SKIP_TAG),true) endif @ echo "-> Releasing $(BINARY) $(VERSION)..." @ okta-awscli - @ $(GOBIN)/goreleaser release --skip-validate --rm-dist --release-notes=notes/$(VERSION).md + @ $(GOBIN)/goreleaser release --skip=validate --clean --release-notes=notes/$(VERSION).md ## Generates a changelog file in notes/$(VERSION) for the next release. changelog: diff --git a/build/Makefile.deps b/build/Makefile.deps index 11fcefdd..cec0c43d 100644 --- a/build/Makefile.deps +++ b/build/Makefile.deps @@ -7,10 +7,10 @@ VERSION_DIR:=$(GOBIN)/versions VERSION_GOLICENSER:=v0.3.0 VERSION_GOLANGCILINT:=v1.54.2 VERSION_GOBINDATA:=v0.0.0-20190711162640-ee3c2418e368 -VERSION_GORELEASER:=v1.2.5 +VERSION_GORELEASER:=v1.21.2 VERSION_VERSIONBUMP:=v1.1.0 -deps: $(GOBIN)/go-licenser $(GOBIN)/golangci-lint $(GOBIN)/go-bindata +deps: $(GOBIN)/go-licenser $(GOBIN)/golangci-lint $(GOBIN)/go-bindata $(GOBIN)/goreleaser $(GOBIN): @ mkdir -p $(GOBIN) @@ -48,7 +48,7 @@ $(VERSION_DIR)/.version-goreleaser-$(VERSION_GORELEASER): | $(VERSION_DIR) $(GOBIN)/goreleaser: $(VERSION_DIR)/.version-goreleaser-$(VERSION_GORELEASER) | $(GOBIN) @ echo "-> Installing goreleaser..." - @ curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh| sh -s -- -b $(GOBIN) $(VERSION_GORELEASER) + @ go install github.com/goreleaser/goreleaser@$(VERSION_GORELEASER) $(VERSION_DIR)/.version-versionbump-$(VERSION_VERSIONBUMP): | $(VERSION_DIR) @ rm -f $(VERSION_DIR)/.version-versionbump-*