From 4acfd450e29ab9ae5f65f15ed8288222494b73ab Mon Sep 17 00:00:00 2001 From: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> Date: Fri, 24 Apr 2026 20:29:31 -0700 Subject: [PATCH 1/3] Update goreleaser to v2 Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> --- .goreleaser.yml | 24 ++++++++---------------- RELEASE.md | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 4137f8574..d22a1ccbd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ +version: 2 before: hooks: - go mod download - # you may remove this if you don't need go generate - go generate ./... project_name: cortextool builds: @@ -76,22 +76,18 @@ builds: - amd64 - 386 archives: - - replacements: - darwin: mac-os - linux: linux - windows: windows - 386: i386 - amd64: x86_64 + - name_template: >- + {{ .Binary }}_{{ .Version }}_{{ if eq .Os "darwin" }}mac-os{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }} format_overrides: - goos: windows - format: zip + formats: [zip] files: - none* - format: binary + formats: [binary] checksum: name_template: 'checksums.txt' snapshot: - name_template: "{{ .Tag }}-next" + version_template: "{{ .Tag }}-next" changelog: sort: asc filters: @@ -99,9 +95,7 @@ changelog: - '^docs:' - '^test:' dockers: - - goos: linux - goarch: amd64 - ids: + - ids: - cortextool-linux dockerfile: cmd/cortextool/GR.Dockerfile image_templates: @@ -114,9 +108,7 @@ dockers: - "--label=org.opencontainers.image.version={{.Version}}" - "--label=repository=https://github.com/cortexproject/cortex-tools" - "--label=homepage=https://cortexmetrics.io" - - goos: linux - goarch: amd64 - ids: + - ids: - benchtool-linux dockerfile: cmd/benchtool/GR.Dockerfile image_templates: diff --git a/RELEASE.md b/RELEASE.md index 78b6d827f..75d3c16b2 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -11,7 +11,7 @@ $ git tag -s "${tag}" -m "${tag}" $ git push origin "${tag}" ``` -3. Run `$ goreleaser release --release-notes=changelogs/v0.3.0.md --rm-dist` where the changelog file is the one created as part of step 1. +3. Run `$ goreleaser release --release-notes=changelogs/v0.3.0.md --clean` where the changelog file is the one created as part of step 1. 4. The docker image will be pushed automatically. From df49b82b39321c9cc222b7f9e346799305c20818 Mon Sep 17 00:00:00 2001 From: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> Date: Fri, 24 Apr 2026 20:56:15 -0700 Subject: [PATCH 2/3] Fix issue with windows builds not generating Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> --- .goreleaser.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index d22a1ccbd..99be484b7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -76,7 +76,25 @@ builds: - amd64 - 386 archives: - - name_template: >- + - id: cortextool + ids: + - cortextool-darwin + - cortextool-linux + - cortextool-windows + name_template: >- + {{ .Binary }}_{{ .Version }}_{{ if eq .Os "darwin" }}mac-os{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }} + format_overrides: + - goos: windows + formats: [zip] + files: + - none* + formats: [binary] + - id: benchtool + ids: + - benchtool-darwin + - benchtool-linux + - benchtool-windows + name_template: >- {{ .Binary }}_{{ .Version }}_{{ if eq .Os "darwin" }}mac-os{{ else }}{{ .Os }}{{ end }}_{{ if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }} format_overrides: - goos: windows From b4c1337719b3bcda356ef0c5c629a73e0ad93345 Mon Sep 17 00:00:00 2001 From: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> Date: Fri, 24 Apr 2026 21:16:49 -0700 Subject: [PATCH 3/3] Use vendor mode and verify modules in goreleaser builds Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> --- .goreleaser.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 99be484b7..81e548f2c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,8 +1,7 @@ version: 2 before: hooks: - - go mod download - - go generate ./... + - go mod verify project_name: cortextool builds: - id: cortextool-darwin @@ -11,6 +10,8 @@ builds: binary: cortextool env: - CGO_ENABLED=0 + flags: + - -mod=vendor main: ./cmd/cortextool/main.go goos: - darwin @@ -23,6 +24,8 @@ builds: binary: cortextool env: - CGO_ENABLED=0 + flags: + - -mod=vendor main: ./cmd/cortextool/main.go goos: - linux @@ -34,6 +37,8 @@ builds: binary: cortextool env: - CGO_ENABLED=0 + flags: + - -mod=vendor main: ./cmd/cortextool/main.go goos: - windows @@ -46,6 +51,8 @@ builds: binary: benchtool env: - CGO_ENABLED=0 + flags: + - -mod=vendor main: ./cmd/benchtool/ goos: - darwin @@ -58,6 +65,8 @@ builds: binary: benchtool env: - CGO_ENABLED=0 + flags: + - -mod=vendor main: ./cmd/benchtool/ goos: - linux @@ -69,6 +78,8 @@ builds: binary: benchtool env: - CGO_ENABLED=0 + flags: + - -mod=vendor main: ./cmd/benchtool/ goos: - windows