Skip to content

Commit 80fda82

Browse files
tmshortPer Goncalves da Silva
andauthored
Update to golang 1.25 (#1866)
* Update to golang 1.25 Requires goreleaser v2.11.2 Updating the darwin build as done downstream Signed-off-by: Todd Short <todd.short@me.com> * fixup! Update to golang 1.25 * Fix goreleaser Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com> --------- Signed-off-by: Todd Short <todd.short@me.com> Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com> Co-authored-by: Per Goncalves da Silva <pegoncal@redhat.com>
1 parent c38b63c commit 80fda82

10 files changed

Lines changed: 742 additions & 1370 deletions

.bingo/Variables.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
3535
@echo "(re)installing $(GOBIN)/golangci-lint-v1.64.8"
3636
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.64.8 "github.com/golangci/golangci-lint/cmd/golangci-lint"
3737

38-
GORELEASER := $(GOBIN)/goreleaser-v1.26.2
38+
GORELEASER := $(GOBIN)/goreleaser-v2.12.7
3939
$(GORELEASER): $(BINGO_DIR)/goreleaser.mod
4040
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
41-
@echo "(re)installing $(GOBIN)/goreleaser-v1.26.2"
42-
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v1.26.2 "github.com/goreleaser/goreleaser"
41+
@echo "(re)installing $(GOBIN)/goreleaser-v2.12.7"
42+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v2.12.7 "github.com/goreleaser/goreleaser/v2"
4343

4444
PROTOC_GEN_GO_GRPC := $(GOBIN)/protoc-gen-go-grpc-v1.3.0
4545
$(PROTOC_GEN_GO_GRPC): $(BINGO_DIR)/protoc-gen-go-grpc.mod

.bingo/goreleaser.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

3-
go 1.22.2
3+
go 1.25.3
44

5-
require github.com/goreleaser/goreleaser v1.26.2
5+
require github.com/goreleaser/goreleaser/v2 v2.12.7

.bingo/goreleaser.sum

Lines changed: 694 additions & 1279 deletions
Large diffs are not rendered by default.

.bingo/variables.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GINKGO="${GOBIN}/ginkgo-v2.23.4"
1414

1515
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.64.8"
1616

17-
GORELEASER="${GOBIN}/goreleaser-v1.26.2"
17+
GORELEASER="${GOBIN}/goreleaser-v2.12.7"
1818

1919
PROTOC_GEN_GO_GRPC="${GOBIN}/protoc-gen-go-grpc-v1.3.0"
2020

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ build: clean $(CMDS) $(OPM)
6262
cross: opm_version_flags=-ldflags "-X '$(PKG)/cmd/opm/version.gitCommit=$(GIT_COMMIT)' -X '$(PKG)/cmd/opm/version.opmVersion=$(OPM_VERSION)' -X '$(PKG)/cmd/opm/version.buildDate=$(BUILD_DATE)'"
6363
cross:
6464
ifeq ($(shell go env GOARCH),amd64)
65-
GOOS=darwin CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 $(GO) build $(opm_version_flags) -tags=$(TAGS) -o "bin/darwin-amd64-opm" --ldflags "-extld=o64-clang" ./cmd/opm
65+
GOOS=darwin CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 CGO_LDFLAGS='-Wl,-undefined,dynamic_lookup' $(GO) build $(opm_version_flags) -tags=$(TAGS) -o "bin/darwin-amd64-opm" --ldflags "-extld=o64-clang -extldflags=-Wl,-undefined,dynamic_lookup" ./cmd/opm
6666
GOOS=windows CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_ENABLED=1 $(GO) build $(opm_version_flags) -tags=$(TAGS) -o "bin/windows-amd64-opm" --ldflags "-extld=x86_64-w64-mingw32-gcc" -buildmode=exe ./cmd/opm
6767
endif
6868

@@ -163,7 +163,7 @@ windows-goreleaser-install:
163163
# This is done to ensure the same version of goreleaser is used across all platforms
164164
mkdir -p $(dir $(GORELEASER))
165165
@echo "(re)installing $(GORELEASER)"
166-
GOWORK=off $(GO) build -mod=mod -modfile=.bingo/goreleaser.mod -o=$(GORELEASER) "github.com/goreleaser/goreleaser"
166+
GOWORK=off $(GO) build -mod=mod -modfile=.bingo/goreleaser.mod -o=$(GORELEASER) "github.com/goreleaser/goreleaser/v2"
167167

168168
# tagged-or-empty returns $(OPM_IMAGE_REPO):$(1) when HEAD is assigned a non-prerelease semver tag,
169169
# otherwise the empty string. An empty string causes goreleaser to skip building

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/operator-framework/operator-registry
22

3-
go 1.24.6
3+
go 1.25.3
44

55
require (
66
github.com/akrylysov/pogreb v0.10.2

release/goreleaser.darwin.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
builds:
23
- id: darwin-amd64
34
main: ./cmd/opm
@@ -36,14 +37,15 @@ builds:
3637
ldflags: *build-ldflags
3738
archives:
3839
- id: opm
39-
builds:
40+
ids:
4041
- darwin-amd64
4142
- darwin-arm64
42-
format: binary
43+
formats:
44+
- binary
4345
name_template: "{{ .Os }}-{{ .Arch }}-{{ .Binary }}"
4446
checksum:
4547
name_template: 'checksums.txt'
4648
snapshot:
47-
name_template: "{{ .Env.OPM_VERSION }}"
49+
version_template: "{{ .Env.OPM_VERSION }}"
4850
release:
4951
disable: true

release/goreleaser.linux.yaml

Lines changed: 26 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
builds:
23
- id: linux-amd64
34
main: ./cmd/opm
@@ -69,90 +70,40 @@ builds:
6970
ldflags: *build-ldflags
7071
archives:
7172
- id: opm
72-
builds:
73+
ids:
7374
- linux-amd64
7475
- linux-arm64
7576
- linux-ppc64le
7677
- linux-s390x
77-
format: binary
78+
formats:
79+
- binary
7880
name_template: "{{ .Os }}-{{ .Arch }}-{{ .Binary }}"
79-
dockers:
80-
- image_templates:
81-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
82-
ids: ["linux-amd64"]
83-
goos: linux
84-
goarch: amd64
85-
dockerfile: release/goreleaser.opm.Dockerfile
86-
extra_files: ["nsswitch.conf"]
87-
use: buildx
88-
build_flag_templates:
89-
- --platform=linux/amd64
90-
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
91-
- image_templates:
92-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
93-
ids: ["linux-arm64"]
94-
goos: linux
95-
goarch: arm64
96-
dockerfile: release/goreleaser.opm.Dockerfile
97-
extra_files: ["nsswitch.conf"]
98-
use: buildx
99-
build_flag_templates:
100-
- --platform=linux/arm64
101-
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
102-
- image_templates:
103-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
104-
ids: ["linux-ppc64le"]
105-
goos: linux
106-
goarch: ppc64le
107-
dockerfile: release/goreleaser.opm.Dockerfile
108-
extra_files: ["nsswitch.conf"]
109-
use: buildx
110-
build_flag_templates:
111-
- --platform=linux/ppc64le
112-
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
113-
- image_templates:
114-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
115-
ids: ["linux-s390x"]
116-
goos: linux
117-
goarch: s390x
118-
dockerfile: release/goreleaser.opm.Dockerfile
119-
extra_files: ["nsswitch.conf"]
120-
use: buildx
121-
build_flag_templates:
122-
- --platform=linux/s390x
123-
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
124-
docker_manifests:
81+
dockers_v2:
12582
# IMAGE_TAG is either set by the Makefile or the goreleaser action workflow,
12683
# This image is intended to be tagged/pushed on all trunk (master, release branch) commits and tags.
127-
- name_template: "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}"
128-
image_templates:
129-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
130-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
131-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
132-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
133-
# Release image builds will be skipped if *_IMAGE_OR_EMPTY variables are empty.
134-
# https://github.com/goreleaser/goreleaser/blob/9ed3c0c/internal/pipe/docker/manifest.go#L105
135-
- name_template: "{{ .Env.MAJ_MIN_IMAGE_OR_EMPTY }}"
136-
image_templates:
137-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
138-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
139-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
140-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
141-
- name_template: "{{ .Env.MAJ_IMAGE_OR_EMPTY }}"
142-
image_templates:
143-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
144-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
145-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
146-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
147-
- name_template: "{{ .Env.LATEST_IMAGE_OR_EMPTY }}"
148-
image_templates:
149-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
150-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
151-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
152-
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
84+
- id: opm-multi-arch
85+
ids:
86+
- linux-amd64
87+
- linux-arm64
88+
- linux-ppc64le
89+
- linux-s390x
90+
dockerfile: release/goreleaser.opm.Dockerfile
91+
extra_files:
92+
- nsswitch.conf
93+
platforms:
94+
- linux/amd64
95+
- linux/arm64
96+
- linux/ppc64le
97+
- linux/s390x
98+
build_args:
99+
GRPC_HEALTH_PROBE_VERSION: "{{ .Env.GRPC_HEALTH_PROBE_VERSION }}"
100+
images:
101+
- "{{ .Env.OPM_IMAGE_REPO }}"
102+
tags:
103+
- "{{ .Env.IMAGE_TAG }}"
153104
checksum:
154105
name_template: 'checksums.txt'
155106
snapshot:
156-
name_template: "{{ .Env.OPM_VERSION }}"
107+
version_template: "{{ .Env.OPM_VERSION }}"
157108
release:
158109
disable: true

release/goreleaser.opm.Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
ARG GRPC_HEALTH_PROBE_VERSION
1010
FROM ghcr.io/grpc-ecosystem/grpc-health-probe:${GRPC_HEALTH_PROBE_VERSION} AS grpc_health_probe
1111
FROM gcr.io/distroless/static:debug
12+
ARG TARGETOS
13+
ARG TARGETARCH
1214
COPY --from=grpc_health_probe /ko-app/grpc-health-probe /bin/grpc_health_probe
1315
COPY ["nsswitch.conf", "/etc/nsswitch.conf"]
14-
COPY opm /bin/opm
16+
COPY ${TARGETOS}/${TARGETARCH}/opm /bin/opm
1517
USER 1001
1618
ENTRYPOINT ["/bin/opm"]

release/goreleaser.windows.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
builds:
23
- id: windows-amd64
34
main: ./cmd/opm
@@ -23,13 +24,14 @@ builds:
2324
- -X {{ .Env.PKG }}/cmd/opm/version.buildDate={{ .Env.BUILD_DATE }}
2425
archives:
2526
- id: opm
26-
builds:
27+
ids:
2728
- windows-amd64
28-
format: binary
29+
formats:
30+
- binary
2931
name_template: "{{ .Os }}-{{ .Arch }}-{{ .Binary }}"
3032
checksum:
3133
name_template: 'checksums.txt'
3234
snapshot:
33-
name_template: "{{ .Env.OPM_VERSION }}"
35+
version_template: "{{ .Env.OPM_VERSION }}"
3436
release:
3537
disable: true

0 commit comments

Comments
 (0)