@@ -139,10 +139,27 @@ export LATEST_IMAGE_OR_EMPTY := $(shell \
139
139
&& [ "$(shell echo -e "$(OPM_VERSION ) \n$(LATEST_TAG ) " | sort -rV | head -n1) " == "$(OPM_VERSION ) " ] \
140
140
&& echo "$(OPM_IMAGE_REPO ) :latest" || echo "")
141
141
RELEASE_GOOS := $(shell go env GOOS)
142
- release : RELEASE_ARGS ?= release --rm-dist --snapshot -f release/goreleaser.$(RELEASE_GOOS ) .yaml
142
+ RELEASE_ARGS ?= release --rm-dist --snapshot -f release/goreleaser.$(RELEASE_GOOS ) .yaml
143
+
144
+ # Note: bingo does not yet support windows (https://github.com/bwplotka/bingo/issues/26)
145
+ # so GOOS=windows gets its own way to install goreleaser
146
+ ifeq ($(RELEASE_GOOS ) , windows)
147
+ GORELEASER := $(shell pwd) /bin/goreleaser
148
+ release : windows-goreleaser-install
149
+ else
143
150
release : $(GORELEASER )
151
+ endif
152
+ release :
144
153
$(GORELEASER ) $(RELEASE_ARGS )
145
154
155
+ .PHONY : windows-goreleaser-install
156
+ windows-goreleaser-install :
157
+ # manually install goreleaser from the bingo directory in the same way bingo (currently) installs it.
158
+ # This is done to ensure the same version of goreleaser is used across all platforms
159
+ mkdir -p $(dir $(GORELEASER ) )
160
+ @echo " (re)installing $( GORELEASER) "
161
+ GOWORK=off $(GO ) build -mod=mod -modfile=.bingo/goreleaser.mod -o=$(GORELEASER ) " github.com/goreleaser/goreleaser"
162
+
146
163
# tagged-or-empty returns $(OPM_IMAGE_REPO):$(1) when HEAD is assigned a non-prerelease semver tag,
147
164
# otherwise the empty string. An empty string causes goreleaser to skip building
148
165
# the manifest image for a trunk commit when it is not a release commit.
0 commit comments