From b36366175a1b333b629b41d4e1c0dfb313987a5f Mon Sep 17 00:00:00 2001 From: Jacopo Andrea Giola Date: Thu, 6 Jun 2024 12:47:58 +0200 Subject: [PATCH] feat: update to goreleaser v2 --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/codeql.yaml | 4 ++-- .goreleaser.yaml | 1 + tools/GORELEASER_VERSION | 2 +- tools/make/build.mk | 2 +- tools/make/test.mk | 15 ++++++++++----- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8c0214e..b939d53 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ on: - examples/** env: - GORELEASER_VERSION: v1.26.2 + GORELEASER_VERSION: v2.0.0 jobs: lint: name: Lint Code @@ -81,7 +81,7 @@ jobs: with: go-version-file: go.mod - name: Setup Goreleaser - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: version: ${{ env.GORELEASER_VERSION }} install-only: true @@ -105,7 +105,7 @@ jobs: with: go-version-file: go.mod - name: Setup Goreleaser - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: version: ${{ env.GORELEASER_VERSION }} install-only: true diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index f222038..336eb4f 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -16,7 +16,7 @@ on: - cron: 0 5 * * 1 # Run every monday at 5 UTC env: - GORELEASER_VERSION: v1.26.2 + GORELEASER_VERSION: v2.0.0 jobs: codeql: @@ -33,7 +33,7 @@ jobs: with: go-version-file: go.mod - name: Setup Goreleaser - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: version: ${{ env.GORELEASER_VERSION }} install-only: true diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d64844b..f14ce10 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,4 @@ +version: 2 dist: bin builds: diff --git a/tools/GORELEASER_VERSION b/tools/GORELEASER_VERSION index 6ce99ef..46b105a 100644 --- a/tools/GORELEASER_VERSION +++ b/tools/GORELEASER_VERSION @@ -1 +1 @@ -v1.26.2 +v2.0.0 diff --git a/tools/make/build.mk b/tools/make/build.mk index 00a2b02..5efb634 100644 --- a/tools/make/build.mk +++ b/tools/make/build.mk @@ -79,4 +79,4 @@ $(TOOLS_BIN)/goreleaser: $(TOOLS_DIR)/GORELEASER_VERSION $(eval GORELEASER_VERSION:= $(shell cat $<)) mkdir -p $(TOOLS_BIN) $(info Installing goreleaser $(GORELEASER_VERSION) bin in $(TOOLS_BIN)) - GOBIN=$(TOOLS_BIN) go install github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) + GOBIN=$(TOOLS_BIN) go install github.com/goreleaser/goreleaser/v2@$(GORELEASER_VERSION) diff --git a/tools/make/test.mk b/tools/make/test.mk index e7f4ca2..1ddacee 100644 --- a/tools/make/test.mk +++ b/tools/make/test.mk @@ -24,31 +24,36 @@ endif ENVTEST_K8S_VERSION?= $(shell cat $(TOOLS_DIR)/ENVTEST_K8S_VERSION) +# needed until the linker warning on macos are fixed +ifeq (Darwin,$(shell uname -s)) +MACOS_LINKER_FLAGS ?= -extldflags=-Wl,-ld_classic +endif + .PHONY: test/unit test/unit: $(info Running tests...) - go test $(GO_TEST_DEBUG_FLAG) -race ./... + go test $(GO_TEST_DEBUG_FLAG) -ldflags="$(MACOS_LINKER_FLAGS)" -race ./... .PHONY: test/integration test/integration: $(info Running integration tests...) - go test $(GO_TEST_DEBUG_FLAG) -tags=integration -race ./... + go test $(GO_TEST_DEBUG_FLAG) -ldflags="$(MACOS_LINKER_FLAGS)" -tags=integration -race ./... .PHONY: test/coverage test/coverage: $(info Running tests with coverage on...) - go test $(GO_TEST_DEBUG_FLAG) -race -coverprofile=coverage.txt -covermode=atomic ./... + go test $(GO_TEST_DEBUG_FLAG) -ldflags="$(MACOS_LINKER_FLAGS)" -race -coverprofile=coverage.txt -covermode=atomic ./... .PHONY: test/integration/coverage test/integration/coverage: $(info Running ci tests with coverage on...) - go test -tags=integration -race -coverprofile=coverage.txt -covermode=atomic ./... + go test $(GO_TEST_DEBUG_FLAG) -ldflags="$(MACOS_LINKER_FLAGS)" -tags=integration -race -coverprofile=coverage.txt -covermode=atomic ./... .PHONY: test/conformance test/conformance/setup test/conformance/teardown test/conformance/setup: test/conformance: $(info Running conformance tests...) - go test -count=1 -tags=conformance -race $(GO_TEST_DEBUG_FLAG) $(CONFORMANCE_TEST_PATH) + go test $(GO_TEST_DEBUG_FLAG) -ldflags="$(MACOS_LINKER_FLAGS)" -tags=conformance -race -count=1 $(CONFORMANCE_TEST_PATH) test/conformance/teardown: test/show/coverage: